Method |
Parameters |
Returns |
Description |
---|---|---|---|
addRowData |
rowid, |
true on success, |
Inserts a new row with id = rowid
containing the data in data (an object) at the position
specified (first in the table, last in the table or before or
after the row specified in srcrowid). The syntax of the
data object is: {name1:value1,name2: value2…} where name is
the name of the column as described in the colModel and the value
is the value. |
clearGridData |
clearfooter |
jqGrid object |
Clears the currently loaded data from grid. If the clearfooter parameter is set to true, the method clears the data placed on the footer row. |
delRowData |
rowid |
true on success, |
Deletes the row with the id = rowid. This operation does not delete data from the server. |
footerData |
action, |
jqGrid object |
This method gets or sets data on footer. See
footerrow in options
array. |
getCell |
rowid, |
cell content |
Returns the content of the cell specified by id =
rowid and column = iCol. iCol can be either the
column index or the name specified in colModel. |
getCol |
colname, returntype, mathoperation |
array[] or value |
This method returns an array with the values from
the column. colname can be either a number that
represents the index of the column or a name from colModel.
returntype determines the type of the returned array. When set to
false (default) the array contain only the values. |
getLocalRow |
rowid |
object |
Returns an array with data of the requested id = rowid. from the local data array.The returned array is of type name:value, where the name is a name from colModel and the value from the associated column in that row. It returns false if the rowid can not be found. The difference from getRowData ia that getRowData returns data in the table, while the getLocal data returns the data from the local data array if any. |
getDataIDs |
none |
array[] |
This method returns an array of the id's in the current grid view. It returns an empty array if no data is available. |
getGridParam |
name |
mixed value |
Returns the value of the requested parameter. name is the name from the options array. If the name is not set, the entry options are returned. For available options, see options. |
getInd |
rowid, |
mixed |
This method returns the index of the row in the grid table specified by id= rowid when rowcontent set to false (default). If rowcontent is set to true, it returns the entry row object. If the rowid can not be found, the function returns false. |
getRowData |
rowid or none |
array{} |
Returns an array with data of the requested id =
rowid. The returned array is of type name:value, where
the name is a name from colModel and the value from the associated
column in that row. It returns an empty array if the rowid can not
be found. |
hideCol |
colname |
jqGrid object |
Given a single colname, it hides the column with
that name. Given an array of colnames [“name1”,”name2”],
it hides the columns with those names, 'name1' and 'name2', in the
example. The names in colname or colnames must all be valid names
from the colModel. |
remapColumns |
permutation, updateCells, keepHeader |
none |
Reorder the grid columns based on the permutation array. The indexes of the permutation array are the current order, the values are the new order. By example if the array has values [1,0,2] after calling this method the first column will be reordered as second. updateCells if set to true will reorder the cell data. keepHeader if set to true will reorder the data above the header cells. |
resetSelection |
none |
jqGrid object |
Resets (unselects) the selected row(s). Also works in multiselect mode. |
setCaption |
caption |
jqGrid object |
Sets a new caption of the grid. If the Caption layer was hidden, it is shown. |
setCell |
rowid, |
jqGrid object |
This method can change the content of particular
cell and can set class or style properties. Where: |
setGridParam |
object |
jqGrid object |
Sets a particular parameter. Note - for some parameters to take effect a trigger(“reloadGrid”) should be executed. Note that with this method we can override events. The name (in the name:value pair) is the name from options array. For a particular options, see options. |
setGridHeight |
new_height |
jqGrid object |
Sets the new height of the grid dynamically. Note that the height is set only to the grid cells and not to the grid. new_height can be in pixels, percentage, or 'auto'. |
setGridWidth |
new_width, |
jqGrid object |
Sets a new width to the grid dynamically. The
parameters are: |
setLabel |
colname, |
jqGrid object |
Sets a new label in the header for the specified
column; can also set attributes and classes . The parameters are:
|
setRowData |
rowid, |
true on success, |
Updates the values (using the data array)
in the row with rowid. The syntax of data array is:
{name1:value1,name2: value2…} where the name is the name of
the column as described in the colModel and the value is the new
value. |
setSelection |
rowid, |
jqGrid object |
Toggles a selection of the row with id = rowid; if onselectrow is true (the default) then the event onSelectRow is launched, otherwise it is not. |
showCol |
colname |
jqGrid object |
Shows a column with a given colname. If the colname is a string we show only the specified column. If colname is array of type [“name1”,”name2”] then the columns with names 'name1' and 'name2' will be shown at the same time The names in colname must be valid names from colModel. The width does not change. |
trigger(“reloadGrid”) |
none |
none |
Reloads the grid with the current settings. This means that a new request is send to the server if datatype is xml or json. This method should be applied to an already-constructed grid. Pay attention that this method does not change HEADER information, that means that any changes to colModel would not be affected. You should use gridUnload to reload new configuration with different colModel |
filterGrid |
grid_id, |
HTML object |
This method can be called to construct an custom search form
for the grid and should be not applied to the grid but to a valid
HTML element. |
filterToolbar |
params |
jqGrid object |
This method is the same as filterGrid, except that the search input elements are placed in the grid just below the header elements. When the header elements are resized the input search elements are also resized according to the new width. Another difference to the filterGrid is that the filter toolbar uses definitions from colModel. For more information refer to Toolbar searching |
getColProp |
colname |
array{} |
Return an array of the properties of the given column name from colModel |
GridDestroy |
grid_id |
true on success, |
Destroys the entry grid with id= grid_id from the DOM (clears all the html associated with the grid and unbinds all events) |
GridUnload |
grid_id |
true on success, |
The only difference to previous method is that the grid is destroyed, but the table element and pager (if any) are left ready to be used again. |
setGridState |
state |
jGrid object |
Show or hide the grid depending and state parameter. When the state is set to 'visible' the grid will be shown. When the parameter is set to 'hidden' the grid will be hidden. Note that the method does not call onHeaderClick event and the caption of the grid is allway visible |
setColProp |
colname, |
jGrid object |
Sets new properties in colModel. This method is ideal for
dynamically changing properties of the column. Note that some
properties - have no effect see colModel
options. For example: |
sortGrid |
colname, |
jqGrid object |
Sorts the given colname and shows the appropriate sort icon. The same (without sorting icon) can be done using setGridParam({sortname:'myname'}).trigger('reloadGrid'). If the reload is set to true, the grid reloads with the current page and sortorder settings. |
updateGridRows |
data, |
true on success, |
This method update the existing data in the grid by given
rowidname. |
groupingGroupBy |
groupname, |
jqGrid object |
This method set a new grouping field. groupname is the name on which we want to group by, groupoptions is object which replaces the groupingView object. |
groupingRemove |
current |
jqGrid object |
Remove the current grouping and clear the grid related grouping rows. If current is set to true only the group rows are removed. If set to false the group rows are removed and the grid is reloaded with the current settings |
bindKeys |
Object |
jqGrid object |
This function add a keyboard navigation in the grid and in the tree grid. Parameter passsed to this method is a object which contain the follwing properties : { onEnter: null, onSpace: null, onLeftKey:null, onRightKey: null, scrolingRows : true } . The onEnterl, onSpace, onLeftKey, onRightKey are events which define what should happen when the appropriate key is pressed. scrolingRows defines if the grid should do automatick scrolling is a vertical scrollbar is available. |