Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:treegrid [2009/09/11 04:18]
klabar remind users that treeGrid does not support currently pager functionaltiy
wiki:treegrid [2017/12/12 17:20] (current)
admin
Line 1: Line 1:
-====== ​TreeGird ​====== +====== ​TreeGrid ​====== 
-Treegrid is a way to represent hierarchical data in grid. \\ Treegrid supports both the Nested Set model and the Adjacency model. Good articles describing the Nested Set model can be found here: \\+Treegrid is a way to represent hierarchical data in grid. \\ Treegrid supports both the Nested Set model and the Adjacency model. Good articles describing the Nested Set model can be found here: \\ 
  
-http://dev.mysql.com/​tech-resources/​articles/​hierarchical-data.html \\  +http://ftp.ntu.edu.tw/​MySQL/​tech-resources/​articles/​hierarchical-data.html \\  
-http://​www.sitepoint.com/​article/​hierarchical-data-database ​+http://​www.sitepoint.com/​article/​hierarchical-data-database ​.
  
 ===== Installation ===== ===== Installation =====
Line 23: Line 23:
 |tree_root_level|numeric|Determines the level where the root element begins when treeGrid is enabled|0| |tree_root_level|numeric|Determines the level where the root element begins when treeGrid is enabled|0|
  
-<​note>​If the gridview option in the grid is set to true the treeGrid will not be constructed instead that set to true.</​note>​+<​note>​If the gridview option in the grid is set to true the treeGrid will not be constructed instead that set to true. </​note> ​
  
 The treeReader property adds dynamically columns to the colModel property of the basic grid when treeGrid property is set to true. The treeReader property adds dynamically columns to the colModel property of the basic grid when treeGrid property is set to true.
Line 51: Line 51:
 var record = jQuery("#​grid_id"​).getInd(rowid,​true);​ var record = jQuery("#​grid_id"​).getInd(rowid,​true);​
 </​code>​ </​code>​
 +NOTE: This no longer works as of version 3.7.x. Use var record = jQuery("#​grid_id"​).getRowData(rowid);​ instead.
 +
 Where rowid is the id of the row. Note the second parameter in the method. If the second parameter is omited or set to false (default) the returned value is the index of the row. If the row can not be found a false is returned. Where rowid is the id of the row. Note the second parameter in the method. If the second parameter is omited or set to false (default) the returned value is the index of the row. If the row can not be found a false is returned.
  
 ^Method^Parameters^Description^ ^Method^Parameters^Description^
 +|addChildNode| nodeid, parentid, data| Add a node in the tree according the value of the parentid parameter. The nodeid is the unique values in the row. If set to empty string the method gets the next max number + 1 from the data. if parendid is null the node is added as root. If the parentid is valid id of existing row the data is added as child of the that row. Data is a data to be inserted.|
 |collapseNode|record|Collapse the node at specified record| |collapseNode|record|Collapse the node at specified record|
 |collapseRow|record|Collapse the current row| |collapseRow|record|Collapse the current row|
Line 67: Line 70:
 |isVisibleNode|record|Returns true or false if the node is visible or not| |isVisibleNode|record|Returns true or false if the node is visible or not|
 |setTreeRow|rowid,​ data| The same as setRowData| |setTreeRow|rowid,​ data| The same as setRowData|
-|SortTree|direction|Direction is '​asc' ​or '​desc'​; sorts the tree with the currently set sortname (sortname is from grid option)|+|SortTree|direction|Direction is 1 (meaning ascending) ​or -1 (meaning descending); sorts the tree with the currently set sortname (sortname is from grid option)|
  
 ===== Cautions and Limitations ===== ===== Cautions and Limitations =====
Line 73: Line 76:
   * Currently adding nodes with addRowData is not supported.   * Currently adding nodes with addRowData is not supported.
   * <​del>​Currently it is not recommended to combine inline editing and form editing with treegrid, or the expanded column will not be editable. </​del>​   * <​del>​Currently it is not recommended to combine inline editing and form editing with treegrid, or the expanded column will not be editable. </​del>​
-  * Adding nodes is currently not supported.+  * <del>Adding nodes is currently not supported.</​del>​
   * [[Pager]] functionality currently disabled for treeGrid   * [[Pager]] functionality currently disabled for treeGrid
 +  * Local searching is not supported at this time
   * When we initialize the grid and the data is read, the datatype is automatically set to local. This is required because treegrid supports autoloading tree nodes. This means that, for speed or efficiency, you can load the data only for the root level first and load the data for a particular child node only when the operator clicks to expand that node. The grid will determine that there is no data and try to load the node from the server, but in this case the data that is sent to the server has to have additional parameters. Setting datatype to local permits intervening before the request is made to build the request correctly. See the  [[Nested Set Model]] and  [[Adjacency Model]] on what is posted to the server   * When we initialize the grid and the data is read, the datatype is automatically set to local. This is required because treegrid supports autoloading tree nodes. This means that, for speed or efficiency, you can load the data only for the root level first and load the data for a particular child node only when the operator clicks to expand that node. The grid will determine that there is no data and try to load the node from the server, but in this case the data that is sent to the server has to have additional parameters. Setting datatype to local permits intervening before the request is made to build the request correctly. See the  [[Nested Set Model]] and  [[Adjacency Model]] on what is posted to the server

QR Code
QR Code wiki:treegrid (generated for current page)