phpDocumentor jqTreeGrid
[ class tree: jqTreeGrid ] [ index: jqTreeGrid ] [ all elements ]

Class: jqTreeGrid

Source Location: /jqTreeGrid.php

Class jqTreeGrid

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From jqGridRender

jqGridRender::$addOptions
jqGridRender::$colModel
jqGridRender::$csvfile
jqGridRender::$csvsep
jqGridRender::$csvsepreplace
jqGridRender::$customCode
jqGridRender::$delOptions
jqGridRender::$editOptions
jqGridRender::$expoptions
jqGridRender::$export
jqGridRender::$exportfile
jqGridRender::$filterOptions
jqGridRender::$gridMethods
jqGridRender::$gridOptions
jqGridRender::$navigator
jqGridRender::$navOptions
jqGridRender::$pdffile
jqGridRender::$runSetCommands
jqGridRender::$searchOptions
jqGridRender::$sharedAddOptions
jqGridRender::$sharedDelOptions
jqGridRender::$sharedEditOptions
jqGridRender::$toolbarfilter
jqGridRender::$viewOptions

Inherited From jqGridEdit

jqGridEdit::$add
jqGridEdit::$buildfields
jqGridEdit::$decodeinput
jqGridEdit::$del
jqGridEdit::$edit
jqGridEdit::$fields
jqGridEdit::$mtype
jqGridEdit::$primaryKey
jqGridEdit::$serialKey
jqGridEdit::$successmsg
jqGridEdit::$trans
jqGridEdit::$_addarray
jqGridEdit::$_addarrayb
jqGridEdit::$_delarray
jqGridEdit::$_delarrayb
jqGridEdit::$_editarray
jqGridEdit::$_editarrayb

Inherited From jqGrid

jqGrid::$cacheCount
jqGrid::$customClass
jqGrid::$customFunc
jqGrid::$dataType
jqGrid::$datearray
jqGrid::$dbdateformat
jqGrid::$dbtimeformat
jqGrid::$dbtype
jqGrid::$debug
jqGrid::$encoding
jqGrid::$errorMesage
jqGrid::$ExportCommand
jqGrid::$getLastInsert
jqGrid::$GridParams
jqGrid::$gSQLMaxRows
jqGrid::$I
jqGrid::$jsonencode
jqGrid::$lastId
jqGrid::$logtofile
jqGrid::$mongofields
jqGrid::$mongointegers
jqGrid::$optimizeSearch
jqGrid::$PDF
jqGrid::$pdo
jqGrid::$performcount
jqGrid::$queryLog
jqGrid::$readFromXML
jqGrid::$select
jqGrid::$SelectCommand
jqGrid::$showError
jqGrid::$SubgridCommand
jqGrid::$table
jqGrid::$tmpvar
jqGrid::$userdata
jqGrid::$userdateformat
jqGrid::$usertimeformat
jqGrid::$version
jqGrid::$xmlCDATA

Inherited From jqGridRender

jqGridRender::addCol()
Add a column at the first or last position in the colModel and sets a certain
jqGridRender::callGridMethod()
Construct a code for execution of valid grid method. This code is putted
jqGridRender::getColModel()
Return the generated colModel
jqGridRender::getGridOption()
Return a jqGrid option specified by the key, false if the option can not be found.
jqGridRender::renderGrid()
Main method which do allmost everthing for the grid.
jqGridRender::setAutocomplete()
Construct autocompleter used in the grid. The autocomplete can be used in the editing modules or/and in search module.
jqGridRender::setButtonOptions()
Set a various options for the buttons on the pager. tite, caption , icon
jqGridRender::setColModel()
Construct the column model of the grid. The model can be passed as array
jqGridRender::setColProperty()
Set a new property in the constructed colModel Return true on success.
jqGridRender::setDatepicker()
Construct a pop up calender used in the grid. The datepicker can be used in the editing modules or/and in search module.
jqGridRender::setFilterOptions()
Set options for the tolbar filter when enabled
jqGridRender::setGridEvent()
Set a valid grid event
jqGridRender::setGridOptions()
Set a grid option. The method uses array with keys corresponding
jqGridRender::setJSCode()
Put a javascript arbitrary code after all things are created. The method is executed only once when the grid is created.
jqGridRender::setNavEvent()
Set a event in the navigator or in the diffrent modules add,edit,del,view, search
jqGridRender::setNavOptions()
Set options in the navigator for the diffrent actions
jqGridRender::setSelect()
Construct the select used in the grid. The select element can be used in the
jqGridRender::setSubGrid()
Prepares a executuion of a simple subgrid Return false if no name options for the subgrid.
jqGridRender::setSubGridGrid()
Prepares a subgrid in the grid expecting any valid html content provieded
jqGridRender::setUrl()
Set a editing url. Note that this set a url from where to obtain and/or edit data.

Inherited From jqGridEdit

jqGridEdit::checkPrimary()
Check for primary key and if not set try to obtain it Return true on success
jqGridEdit::delete()
Delete the data into the database according the table element
jqGridEdit::editGrid()
Perform the all CRUD operations depending on the oper param send from the grid and the table element 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.
jqGridEdit::getFields()
Return the fields generated for CRUD operations
jqGridEdit::getPrimaryKeyId()
Return the primary key of the table
jqGridEdit::insert()
Insert the data array into the database according to the table element.
jqGridEdit::setAfterCrudAction()
Run a sql command(s) after the operation from the CRUD is succefull.
jqGridEdit::setBeforeCrudAction()
Run a sql command(s) before the operation from the CRUD.
jqGridEdit::setPrimaryKeyId()
Set a primary key for the table
jqGridEdit::setSuccessMsg()
Set the message which will be send to client side grid when succefull CRUD operation is performed. Usually afterSubmit event should be used in this case.
jqGridEdit::setTable()
Set table for CRUD and build the fields
jqGridEdit::update()
Update the data into the database according the table element
jqGridEdit::_actionsCRUDGrid()
Executes the sql command after the crud is succefull
jqGridEdit::_buildFields()
Build the fields array with a database fields from the table.

Inherited From jqGrid

jqGrid::__construct()
Constructor
jqGrid::addUserData()
Add a custom data to the grid footer row if it is enabled.
jqGrid::buildSearch()
Build a search string from filter string posted from the grid
jqGrid::debugout()
Prints all executed SQL queries to file or console
jqGrid::execute()
Executes a prepared sql statement. Also if limit is set to true is used
jqGrid::exportToCsv()
Public method to export a grid data to csv data.
jqGrid::exportToExcel()
Export the recordset to excel xml file.
jqGrid::exportToPdf()
Export the recordset to pdf file.
jqGrid::getDbDate()
Return the current date format used in the undelayed database
jqGrid::getDbTime()
Return the current datetime format used in the undelayed database
jqGrid::getGridParams()
Return the associative array which contain the parameters that are sended from the grid to request, search, update delete data.
jqGrid::getSqlElement()
Read a xml file and the SelectCommand and return the sql string Return string if the query is found false if not.
jqGrid::getStringForGroup()
Recursivley build the sql query from a json object
jqGrid::getUserDate()
Return the current date format used from the client
jqGrid::getUserTime()
Return the current datetime format used from the client
jqGrid::logQuery()
Log query
jqGrid::parseSql()
Prepares a $sqlElement and binds a parameters $params
jqGrid::queryForObject()
Return the object from the query
jqGrid::queryGrid()
Return the result of the query to jqGrid. Support searching
jqGrid::querySubGrid()
Return the result of the query for the simple subgrid
jqGrid::rs2excel()
From a given recordset returns excel xml file. If the summary array is defined add summary formula at last row.
jqGrid::rs2pdf()
Convert a recordeset to pdf object
jqGrid::selectLimit()
Will select, getting rows from $offset (1-based), for $nrows.
jqGrid::sendErrorHeader()
Function to simulate 500 Internal error so that it sends the error to the client. It is activated only if $showError is true.
jqGrid::setDbDate()
Set a new database date format using PHP convensions
jqGrid::setDbTime()
Set a new database datetime format using PHP convensions
jqGrid::setGridParams()
Set a grid parameters to identify the action from the grid Note that these should be set in the grid - i.e the parameters from the grid should equal to the GridParams.
jqGrid::setPdfOptions()
Set options for PDF export.
jqGrid::setUserDate()
Set a new user date format using PHP convensions
jqGrid::setUserTime()
Set a new user datetime format using PHP convensions
jqGrid::_buildSearch()
Builds the search where clause when the user perform a search Return arrray the first element is a strinng with the where clause, the second element is array containing the value parameters passed to the sql.
jqGrid::_getcount()
Returns object which holds the total records in the query and optionally
jqGrid::_gridResponse()
Check in which format data should be returned to the grid based on dataType property
jqGrid::_rs()
Convert the query to record set and set the summary data if available
jqGrid::_setSQL()
Bulid the sql based on $readFromXML, $SelectCommand and $table variables

[ Top ]
Property Summary
boolean   $autoLoadNodes   If set to false all data is available at client side
boolean   $expandAll   Should be all nodes expanded when loaded at client

[ Top ]
Method Summary
boolean   deleteTreeNode()   Delete the data into the database according the table element and tree grid model.
void   editTree()   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.
void   getChildNodes()   Return all Child nodes for both methods. The data is populated in the protected variable $res.
array   getChildren()   Return the child nodes of a given node. If the node is not specifies return
array   getLeafNodes()   Return the leaf nodes when the adjacency model is used.
array   getRoots()   Return the root nodes when adjacency model. Uses data array
array   getTableConfig()   Return the curent configuration for the model used
string   getTreeModel()   Returns the currently used tree model
boolean   insertTreeNode()   Insert the data array into the database according to the table element and tree model.
mixed   queryTree()   Return the result of the query to jqTreeGrid. Currently does not support searching.
mixed.   renderTree()   Main method which do allmost everthing for the tree grid.
void   setData()   Se the tree data for future processing
void   setLeafData()   Set a leaf nodes for adjacency model
void   setTableConfig()   Set the configuration fields for the model used.
void   setTreeModel()   Set the tree mode used. Can be adjacency or nested. Deafault is nested
boolean   updateTreeNode()   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.

[ Top ]
Properties
boolean   $autoLoadNodes = true [line 65]

If set to false all data is available at client side

API Tags:
Access:  public


[ Top ]
boolean   $expandAll = false [line 60]

Should be all nodes expanded when loaded at client

API Tags:
Access:  public


[ Top ]
Methods
deleteTreeNode  [line 571]

  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:
Access:  public


[ Top ]
editTree  [line 634]

  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:
Access:  public


[ Top ]
getChildNodes  [line 173]

  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:
Access:  protected


[ Top ]
getChildren  [line 222]

  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:
Access:  protected


[ Top ]
getLeafNodes  [line 130]

  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


[ Top ]
getRoots  [line 247]

  array getRoots( )

Return the root nodes when adjacency model. Uses data array


API Tags:
Access:  protected


[ Top ]
getTableConfig  [line 120]

  array getTableConfig( )

Return the curent configuration for the model used


API Tags:
Access:  public


[ Top ]
getTreeModel  [line 95]

  string getTreeModel( )

Returns the currently used tree model


API Tags:
Access:  public


[ Top ]
insertTreeNode  [line 507]

  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


[ Top ]
queryTree  [line 468]

  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:
Access:  public


[ Top ]
renderTree  [line 704]

  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:
Access:  public


[ Top ]
setData  [line 71]

  void setData( array $d  )

Se the tree data for future processing

Parameters:
array   $d: 

API Tags:
Access:  public


[ Top ]
setLeafData  [line 78]

  void setLeafData( array $d  )

Set a leaf nodes for adjacency model

Parameters:
array   $d: 

API Tags:
Access:  public


[ Top ]
setTableConfig  [line 107]

  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:
array   $aconfig: 

API Tags:
Access:  public


[ Top ]
setTreeModel  [line 85]

  void setTreeModel( [string $model = 'nested']  )

Set the tree mode used. Can be adjacency or nested. Deafault is nested

Parameters:
string   $model: 

API Tags:
Access:  public


[ Top ]
updateTreeNode  [line 490]

  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:
Access:  public


[ Top ]

Documentation generated on Wed, 22 Jun 2011 14:57:50 +0300 by phpDocumentor 1.4.3