category_tree::get_multirow (public)

 category_tree::get_multirow [ -tree_id tree_id ] \
    [ -subtree_id subtree_id ] [ -assign_single_p assign_single_p ] \
    [ -require_category_p require_category_p ] \
    [ -container_id container_id ] \
    [ -category_counts category_counts ] [ -append ] \
    [ -datasource datasource ]

Defined in packages/categories/tcl/category-trees-procs.tcl

get a multirow datasource for a given tree or for all trees mapped to a given container. datasource is: tree_id tree_name category_id category_name level pad deprecated_p count child_sum where:

  • mapped_p indicates the category_id was found in the list mapped_ids.
  • child_sum is the naive sum of items mapped to children (may double count)
  • count is the number of items mapped directly to the given category
  • pad is a stupid hard coded pad for the tree (I think trees should use nested lists and css)
Here is an example of how to use this in adp:
    <multiple name="categories">
      <h2>@categories.tree_name@</h2>
      <ul>
      <group column="tree_id">
        <if @categories.count@ gt 0 or @categories.child_sum@ gt 0>
          <li>@categories.pad;noquote@<a href="@categories.category_id@">@categories.category_name@</a>
          <if @categories.count@ gt 0>(@categories.count@)</if></li>
        </if>
      </group>
    </multiple>
    

Switches:
-tree_id
(optional)
tree_id or container_id must be provided.
-subtree_id
(optional)
-assign_single_p
(defaults to "f") (optional)
-require_category_p
(defaults to "f") (optional)
-container_id
(optional)
returns all mapped trees for the given container_id
-category_counts
(optional)
list of category_id and counts {catid count cat count ... }
-append
(boolean) (optional)
-datasource
(optional)
the name of the datasource to create.
Author:
Jeff Davis davis@xarg.net

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_crud category_crud (test categories) category_tree::get_multirow category_tree::get_multirow test_category_crud->category_tree::get_multirow category_tree::get_mapped_trees category_tree::get_mapped_trees (public) category_tree::get_multirow->category_tree::get_mapped_trees category_tree::get_name category_tree::get_name (public) category_tree::get_multirow->category_tree::get_name category_tree::get_tree category_tree::get_tree (public) category_tree::get_multirow->category_tree::get_tree template::multirow template::multirow (public) category_tree::get_multirow->template::multirow packages/categories/lib/list-categories.tcl packages/categories/ lib/list-categories.tcl packages/categories/lib/list-categories.tcl->category_tree::get_multirow

Testcases:
category_crud
[ show source ]
Show another procedure: