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

Class: jqGridRender

Source Location: /jqGrid.php

Class jqGridRender

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

Inherited From jqGridEdit

jqGridEdit::$add
jqGridEdit::$buildfields
jqGridEdit::$decodeinput
jqGridEdit::$del
jqGridEdit::$edit
jqGridEdit::$fields
jqGridEdit::$mtype
jqGridEdit::$primaryKey
jqGridEdit::$serialKey
jqGridEdit::$trans

Inherited From jqGrid

jqGrid::$cacheCount
jqGrid::$customClass
jqGrid::$customFunc
jqGrid::$dataType
jqGrid::$datearray
jqGrid::$dbdateformat
jqGrid::$dbtimeformat
jqGrid::$dbtype
jqGrid::$debug
jqGrid::$encoding
jqGrid::$ExportCommand
jqGrid::$GridParams
jqGrid::$gSQLMaxRows
jqGrid::$I
jqGrid::$jsonencode
jqGrid::$logtofile
jqGrid::$optimizeSearch
jqGrid::$pdo
jqGrid::$queryLog
jqGrid::$readFromXML
jqGrid::$select
jqGrid::$SelectCommand
jqGrid::$SubgridCommand
jqGrid::$table
jqGrid::$userdata
jqGrid::$userdateformat
jqGrid::$usertimeformat
jqGrid::$version
jqGrid::$xmlCDATA

Inherited From jqGridEdit

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::setPrimaryKeyId()
Set a primary key for the table
jqGridEdit::setTable()
Set table for CRUD and build the fields
jqGridEdit::update()
Update the data into the database according the table element
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::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::exportToExcel()
Export the recordset to excel xml 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::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::selectLimit()
Will select, getting rows from $offset (1-based), for $nrows.
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::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::_setSQL()
Bulid the sql based on $readFromXML, $SelectCommand and $table variables

[ Top ]
Property Summary
array   $addOptions   Default add form dialog options
array   $colModel   Holds the colModel for the grid. Can be passed as param or created
string   $customCode   Custom java script code which is set after creation of the grid
array   $delOptions   Default delete form dialog options
array   $editOptions   Default editing form dialog options
boolean   $export   Enable/disable the export to excel
string   $exportfile   The export to file to excel
array   $filterOptions   Default fileter toolbar search options
array   $gridMethods   Holds the grid methods.
array   $gridOptions   Default grid parameters
boolean   $navigator   Enable/disable navigator in the grid. Default false
array   $navOptions   Default navigaror options
boolen   $runSetCommands   When set to false some set comands are not executed for spped improvements Usual this is done after setColModel.
array   $searchOptions   Default search options
boolean   $toolbarfilter   Enable/disable tollbar search. Default false
array   $viewOptions   Default view form dialog options

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

[ Top ]
Properties
array   $addOptions = array("drag"=>true,"resize"=>true,"closeOnEscape"=>true, "dataheight"=>150) [line 1640]

Default add form dialog options

API Tags:
Access:  protected


[ Top ]
array   $colModel = array() [line 1667]

Holds the colModel for the grid. Can be passed as param or created

automatically

API Tags:
Access:  protected


[ Top ]
string   $customCode = "" [line 1684]

Custom java script code which is set after creation of the grid

API Tags:
Access:  protected


[ Top ]
array   $delOptions = array() [line 1650]

Default delete form dialog options

API Tags:
Access:  protected


[ Top ]
array   $editOptions = array("drag"=>true,"resize"=>true,"closeOnEscape"=>true, "dataheight"=>150) [line 1635]

Default editing form dialog options

API Tags:
Access:  protected


[ Top ]
boolean   $export = true [line 1620]

Enable/disable the export to excel

API Tags:
Access:  public


[ Top ]
string   $exportfile = 'exportdata.xml' [line 1625]

The export to file to excel

API Tags:
Access:  public


[ Top ]
array   $filterOptions = array("stringResult"=>true) [line 1660]

Default fileter toolbar search options

API Tags:
Access:  protected


[ Top ]
array   $gridMethods = array() [line 1679]

Holds the grid methods.

API Tags:
Access:  protected


[ Top ]
array   $gridOptions = array(
"width"=>"650",
"hoverrows"=>false,
"viewrecords"=>true,
"jsonReader"=>array("repeatitems"=>false, "subgrid"=>array("repeatitems"=>false)),"xmlReader"=>array("repeatitems"=>false,"subgrid"=>array("repeatitems"=>false)),"gridview"=>true)
[line 1598]

Default grid parameters

API Tags:
Access:  protected


[ Top ]
boolean   $navigator = false [line 1610]

Enable/disable navigator in the grid. Default false

API Tags:
Access:  public


[ Top ]
array   $navOptions = array("edit"=>true,"add"=>true,"del"=>true,"search"=>true,"refresh"=>true, "view"=>false, "excel"=>true) [line 1630]

Default navigaror options

API Tags:
Access:  protected


[ Top ]
boolen   $runSetCommands = true [line 1674]

When set to false some set comands are not executed for spped improvements Usual this is done after setColModel.

API Tags:
Access:  protected


[ Top ]
array   $searchOptions = array("drag"=>true, "closeAfterSearch"=>true, "multipleSearch"=>true) [line 1655]

Default search options

API Tags:
Access:  protected


[ Top ]
boolean   $toolbarfilter = false [line 1615]

Enable/disable tollbar search. Default false

API Tags:
Access:  public


[ Top ]
array   $viewOptions = array("drag"=>true,"resize"=>true,"closeOnEscape"=>true, "dataheight"=>150) [line 1645]

Default view form dialog options

API Tags:
Access:  protected


[ Top ]
Methods
addCol  [line 2268]

  boolean addCol( $aproperties, [string $position = 'last']  )

Add a column at the first or last position in the colModel and sets a certain

properties to it

Parameters:
array   $aproperties:  data representing the column properties - including name, label...
string   $position:  can be first or last or number - default is first. If a number is set the column is added before the position corresponded to the position in colmodel

API Tags:
Access:  public


[ Top ]
callGridMethod  [line 2129]

  void callGridMethod( string $grid, string $method, [ $aoptions = null]  )

Construct a code for execution of valid grid method. This code is putted

after the creation of the grid

Parameters:
string   $grid:  valid grid id should be putted as #mygrid
string   $method:  valid grid method
array   $aoptions:  contain the parameters passed to the method. Omit this parameter if the method does not have parameters

API Tags:
Access:  public


[ Top ]
getColModel  [line 1690]

  array getColModel( )

Return the generated colModel


API Tags:
Access:  public


[ Top ]
getGridOption  [line 1701]

  mixed getGridOption( string $key  )

Return a jqGrid option specified by the key, false if the option can not be found.

Parameters:
string   $key:  the named grid option

API Tags:
Access:  public


[ Top ]
renderGrid  [line 2314]

  mixed. renderGrid( [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 grid

Construct the grid, perform CRUD operations, perform Query and serch operations, export to excel, 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 ]
setAutocomplete  [line 1897]

  void setAutocomplete( string $colname, [string $target = false], [mixed $data = ''], [array $options = null], [boolean $editing = true], [ $searching = false], boolean $seraching  )

Construct autocompleter used in the grid. The autocomplete can be used in the editing modules or/and in search module.

Parameters:
string   $colname:  (requiered) valid colname in colModel
string   $target:  if set determines the input element on which the value will be set after the selection in the autocompleter
mixed   $data:  can be array or string which is the SQL command which is executed to obtain the values. The command can contain one, two or three fields. If the field in SQL command is one, then this this field will be displayed and setted as value in the element. If the fields in SQL command are two, then the second field will be displayed but the first will be setted as value in the element.
array   $options:  - array with options for the autocomplete. Can be all available options from jQuery UI autocomplete in pair name=>value. In case of events a "js:" tag should be added before the value. Additionally to this the following options can be used - cache, searchType, ajaxtype, itemLiength. For more info refer to docs.
boolean   $editing:  determines if the autocomplete should be used in editing modules. Deafult is true
boolean   $seraching:  determines if the autocomplete should be present in the search module. Deafult is true.
   $searching: 

API Tags:
Access:  public
Uses:  jqAutocomplete - class. This requiere to include jqAutocomplete.php in order to work


[ Top ]
setColModel  [line 2170]

  boolean setColModel( [ $model = null], [ $params = null], [ $labels = null]  )

Construct the column model of the grid. The model can be passed as array

or can be constructed from sql. See _setSQL() to determine which SQL is used. The method try to determine the primary key and if it is found is set as key:true to the appropriate field. If the primary key can not be determined set the first field as key:true in the colModel. Return true on success.

Parameters:
array   $model:  if set construct the model ignoring the SQL command
array   $params:  if a sql command is used parametters passed to the SQL
array   $labels:  if this parameter is set it set the labels in colModel. The array should be associative which key value correspond to the name of colModel

API Tags:
See:  jqGrid::_setSQL()
Access:  public


[ Top ]
setColProperty  [line 2234]

  boolean setColProperty( mixed $colname, $aproperties  )

Set a new property in the constructed colModel Return true on success.

Parameters:
mixed   $colname:  valid coulmn name or index in colModel
array   $aproperties:  the key name properties.

API Tags:
Access:  public


[ Top ]
setDatepicker  [line 1977]

  void setDatepicker( string $colname, [array $options = null], [boolean $editing = true], [ $searching = true], boolean $seraching  )

Construct a pop up calender used in the grid. The datepicker can be used in the editing modules or/and in search module.

Parameters:
string   $colname:  (requiered) valid colname in colModel
array   $options:  - array with options for the datepicker. Can be all available options from jQuery UI datepicker in pair name=>value. In case of events a "js:" tag should be added before the value.
boolean   $editing:  determines if the datepicker should be used in editing modules. Deafult is true
boolean   $seraching:  determines if the datepicker should be present in the search module. Deafult is true.
   $searching: 

API Tags:
Access:  public
Uses:  jqCalender - class. This requiere to include jqCalender.php in order to work


[ Top ]
setFilterOptions  [line 2114]

  void setFilterOptions( array $aoptions  )

Set options for the tolbar filter when enabled

Parameters:
array   $aoptions:  valid options for the filterToolbat

API Tags:
Access:  public


[ Top ]
setGridEvent  [line 2019]

  bolean setGridEvent( string $event, string $code  )

Set a valid grid event

Parameters:
string   $event:  - valid grid event
string   $code:  Javascript code which will be executed when the event raises

API Tags:
Access:  public


[ Top ]
setGridOptions  [line 1713]

  void setGridOptions( array $aoptions  )

Set a grid option. The method uses array with keys corresponding

to the jqGrid options as described in jqGrid docs

Parameters:
array   $aoptions:  A key name pair. Some options can be array to.

API Tags:
Access:  public


[ Top ]
setJSCode  [line 2148]

  void setJSCode( string $code  )

Put a javascript arbitrary code after all things are created. The method is executed only once when the grid is created.

Parameters:
string   $code:  - javascript to be executed

API Tags:
Access:  public


[ Top ]
setNavEvent  [line 2076]

  boolean setNavEvent( string $module, string $event, string $code  )

Set a event in the navigator or in the diffrent modules add,edit,del,view, search

Parameters:
string   $module:  - can be navigator, add, edit, del, view
string   $event:  - valid event for the particular module
string   $code:  - javascript code to be executed when the event occur

API Tags:
Access:  public


[ Top ]
setNavOptions  [line 2034]

  boolean setNavOptions( string $module, array $aoptions  )

Set options in the navigator for the diffrent actions

Parameters:
string   $module:  - can be navigator, add, edit, del, view
array   $aoptions:  options that are applicable to this module The key correspond to the options in jqGrid

API Tags:
Access:  public


[ Top ]
setSelect  [line 1828]

  boolean setSelect( string $colname, mixed $data, [boolean $formatter = true], [boolean $editing = true], [boolean $seraching = true], [array $defvals = array()]  )

Construct the select used in the grid. The select element can be used in the

editing modules, in formatter or in search module

Parameters:
string   $colname:  (requiered) valid colname in colmodel
mixed   $data:  can be array (with pair key value) or string which is the SQL command which is executed to obtain the values. The command should contain a minimun two fields. The first is the key and the second is the value whch will be displayed in the select
boolean   $formatter:  deternines that the select should be used in the formatter of type select. Default is true
boolean   $editing:  determines if the select should be used in editing modules. Deafult is true
boolean   $seraching:  determines if the select should be present in the search module. Deafult is true.
array   $defvals:  Set the default value if none is selected. Typically this is usefull in serch modules. Can be something like arrar(""=>"All");

API Tags:
Access:  public


[ Top ]
setSubGrid  [line 1752]

  boolean setSubGrid( [string $suburl = ''], [array $subnames = false], [array $subwidth = false], [array $subalign = false], [array $subparams = false]  )

Prepares a executuion of a simple subgrid Return false if no name options for the subgrid.

Parameters:
string   $suburl:  Url from where to get the data
array   $subnames:  Required - the names that should correspond to fields of the data
array   $subwidth:  (optional) - sets a width of the subgrid columns. Default 100
array   $subalign:  (optional) - set the aligmend of the columns. default center
array   $subparams:  (optional) additional parameters that can be passed when the subgrid plus icon is clicked. The names should be present in colModel in order to pass the values

API Tags:
Access:  public


[ Top ]
setSubGridGrid  [line 1776]

  boolean setSubGridGrid( string $subgridurl, [array $subgridnames = null]  )

Prepares a subgrid in the grid expecting any valid html content provieded

via the $suggridurl

Parameters:
string   $subgridurl:  url from where to get html content
array   $subgridnames:  a array with names from colModel which values will be posted to the server

API Tags:
Access:  public


[ Top ]
setUrl  [line 1729]

  boolean setUrl( string $newurl  )

Set a editing url. Note that this set a url from where to obtain and/or edit data.

Return false if runSetCommands is already runned (false)

Parameters:
string   $newurl:  the new url

API Tags:
Access:  public


[ Top ]

Documentation generated on Thu, 16 Sep 2010 11:18:56 +0300 by phpDocumentor 1.4.3