boolean deleteTreeNode(
array
$data
)
|
|
Delete the data into the database according the table element and tree grid model.
A primaryKey should be set. If the key is not set It can be obtained from jqGridDB::getPrimaryKey Return true on success, false when the operation is not succefull
Parameters:
array |
$data: |
associative array which key values correspond to the names in the delete command |
API Tags:
void editTree(
[
$summary = null], [
$params = null], [string
$oper = false], [
$echo = true]
)
|
|
Perform the all CRUD operations depending on the oper param send from the grid, the table element and the treegrid model If the primaryKey is not set we try to obtain it using jqGridDB::getPrimaryKey If the primary key is not set or can not be obtained the operation is aborted.
Also the method call the queryTree to perform the tree ouput
Parameters:
array |
$summary: |
- set which columns should be sumarized in order to be displayed to the grid By default this parameter uses SQL SUM function: array("colmodelname"=>"sqlname"); It can be set to use the other one this way array("colmodelname"=>array("sqlname"=>"AVG")); By default the first field correspond to the name of colModel the second to the database name |
array |
$params: |
additional parameters that can be passed to the query |
string |
$oper: |
if set the requested oper operation is performed without to check the parameter sended from the grid. |
|
$echo: |
|
API Tags:
void getChildNodes(
integer
$node, [string
$order_field = ''], [boolean
$id = false]
)
|
|
Return all Child nodes for both methods. The data is populated in the protected variable $res.
Parameters:
integer |
$node: |
the id of the node |
string |
$order_field: |
- optional order field |
boolean |
$id: |
what to return - only the id of the noes or all the data of the child nodes. Deafult is false |
API Tags:
array getChildren(
[integer
$node_id = null]
)
|
|
Return the child nodes of a given node. If the node is not specifies return
the root nodes. Used only in adjacency model. Uses the data array
Parameters:
integer |
$node_id: |
the id of the node |
API Tags:
array getLeafNodes(
[integer
$node = 0]
)
|
|
Return the leaf nodes when the adjacency model is used.
Note that the table and table configuration should be set
Parameters:
integer |
$node: |
- the id of the node |
API Tags:
Return: | of the leaf nodes |
Access: | public |
Return the root nodes when adjacency model. Uses data array
API Tags:
Return the curent configuration for the model used
API Tags:
Returns the currently used tree model
API Tags:
boolean insertTreeNode(
array
$data
)
|
|
Insert the data array into the database according to the table element and tree model.
A primaryKey should be set. If the key is not set It can be obtained from jqGridDB::getPrimaryKey. The table config for the tree should be set.
Parameters:
array |
$data: |
associative array which key values correspond to the names in the table. |
API Tags:
See: | setTableConfig
Return true on succes, false otherwiese. |
Access: | public |
mixed queryTree(
[
$summary = null], [
$params = null], [boolen
$echo = true]
)
|
|
Return the result of the query to jqTreeGrid. Currently does not support searching.
Parameters:
array |
$summary: |
- set which columns should be sumarized in order to be displayed to the grid By default this parameter uses SQL SUM function: array("colmodelname"=>"sqlname"); It can be set to use the other one this way array("colmodelname"=>array("sqlname"=>"AVG")); By default the first field correspond to the name of colModel the second to the database name |
array |
$params: |
- parameter values passed to the sql |
boolen |
$echo: |
if set to false return the records as object, otherwiese json encoded or xml string depending on the dataType variable |
API Tags:
mixed. renderTree(
[string
$tblelement = ''], [string
$pager = ''], [boolean
$script = true], [
$summary = null], [
$params = null], [boolean
$createtbl = false], [boolean
$createpg = false], [boolean
$echo = true]
)
|
|
Main method which do allmost everthing for the tree grid.
Construct the tree grid, perform CRUD operations, perform Query set a jqGrid method, and javascript code.
Parameters:
string |
$tblelement: |
the id of the table element to costrict the grid |
string |
$pager: |
the id for the pager element |
boolean |
$script: |
if set to true add a script tag before constructin the grid. |
array |
$summary: |
- set which columns should be sumarized in order to be displayed to the grid By default this parameter uses SQL SUM function: array("colmodelname"=>"sqlname"); It can be set to use other one this way : array("colmodelname"=>array("sqlname"=>"AVG")); By default the first field correspond to the name of colModel the second to the database name |
array |
$params: |
parameters passed to the query |
boolean |
$createtbl: |
if set to true the table element is created automatically from this method. Default is false |
boolean |
$createpg: |
if set to true the pager element is created automatically from this script. Default false. |
boolean |
$echo: |
if set to false the function return the string representing the grid |
API Tags:
Se the tree data for future processing
Parameters:
API Tags:
void setLeafData(
array
$d
)
|
|
Set a leaf nodes for adjacency model
Parameters:
API Tags:
void setTableConfig(
array
$aconfig
)
|
|
Set the configuration fields for the model used.
For the adjacency model a 'id' and 'parent' should be set For the nested model 'id', 'left', 'right' and 'level' should be set Optional fields for all models : expanded, icon, leaf, loaded
Parameters:
API Tags:
void setTreeModel(
[string
$model = 'nested']
)
|
|
Set the tree mode used. Can be adjacency or nested. Deafault is nested
Parameters:
API Tags:
boolean updateTreeNode(
array
$data
)
|
|
Update the data into the database according the table element A primaryKey should be set. If the key is not set It can be obtained from jqGridDB::getPrimaryKey.
Return true on success, false when the operation is not succefull
Parameters:
array |
$data: |
associative array which key values correspond to the names in the table |
API Tags: