TreeReader Properties

The treeReader property adds columns to the colModel property of the basic grid.

Syntax:

treeReader: [ {property1:'value1'}, {property2:'value2'}, {...}, ... ]

These properties, in alphabetic sequence, are the following:

Property Type Description Default
expanded_field string true or false tells us if the tree at this level should be expanded when read from grid. If this field is true, child nodes should also be sent to the grid. false
leaf_field string true or false  
left_field numeric    
level_field numeric    
right_field numeric    

It is important to note here that the data returned from the server should be sorted in an appropriate way; for example

SELECT category_name, level, lft, rgt FROM categories ORDER BY lft;

leaf_field is easy in a Nested set model since
if( rgt == lft+1 ) isLeaf = true; else isLeaf = false;



  Last Updated: 2/15/2009 | © Tony's jqGrid - a jQuery Plugin, 2010