In order to work the nested set model in jqTreeGrid is requiered to have three field - left , right and level.
$tableconfigarray = array("left"=>"lft", "right"=>"rgt", "level"=>"level", "id"=>"id")
Another requirments is to have uniquie id in the table and in most cases this id is requiered to be serial (autoincremet) integer field.
For this purpose the id field should be set to. It is not neccesary to set this field if it is set as primary and serial in the tree grid definitions.
Two methods are connected with these settings
$tree->setTreeMode('nested') - sets the tree model
and
$tree->setTableConfig(array(....)); set the system fields for the tree.
By example if the table that holds the tree data is called nested_category and the id primary autoincremented field is called account_id and the other system fields have the default names, the following example prepares correct the tree grid:
<?php ... // set the table and primary key $tree->table = 'nested_category'; $tree->setPrimaryKeyId('category_id'); // set model $tree->setTreeModel('nested'); //set the table configuration $tree->setTableConfig(array('id'=>'category_id', 'left'=>'lft', 'right'=>'rgt', 'level'=>'level')); ... ?>