Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:methods [2012/09/04 08:09]
tsahi saveRow callback parameter - xmlhttprequest
wiki:methods [2018/02/02 20:53] (current)
admin
Line 1: Line 1:
-~~ODT~~ 
 ====== Methods ====== ====== Methods ======
 This chapter describes the basic methods of jqGrid. Some methods require that additional modules should be loaded. \\  This chapter describes the basic methods of jqGrid. Some methods require that additional modules should be loaded. \\ 
 As of version 3.6 jqGrid uses new API which is compatible with jQuery UI library. See below. As of version 3.6 jqGrid uses new API which is compatible with jQuery UI library. See below.
-See also [[wiki:​events|jqGrid Events]].+See also [[wiki:​events|jqGrid Events]]
 ===== Grid Related Methods ===== ===== Grid Related Methods =====
  
Line 65: Line 64:
 <​head>​ <​head>​
 <meta http-equiv="​Content-Type"​ content="​text/​html;​ charset=utf-8"​ /> <meta http-equiv="​Content-Type"​ content="​text/​html;​ charset=utf-8"​ />
 +<meta http-equiv="​X-UA-Compatible"​ content="​IE=edge"​ />
 <​title>​My First Grid</​title>​ <​title>​My First Grid</​title>​
   ​   ​
Line 112: Line 112:
 |resetSelection|none|jqGrid object|Resets (unselects) the selected row(s). Also works in multiselect mode.| |resetSelection|none|jqGrid object|Resets (unselects) the selected row(s). Also works in multiselect mode.|
 |restoreRow|rowid|none?​|Restores the data to original values before the editing of the row specified by **rowid**.| |restoreRow|rowid|none?​|Restores the data to original values before the editing of the row specified by **rowid**.|
-|saveRow|rowid,​\\ callback,\\ url,\\ extraparams\\ |none?​|Saves the row specified by **rowid**. **callback** is a function called after the save is complete. The function accepts an XMLHttpRequest object with the response from the server. **url** is the URL used to submit the values. If specified, this value overrides the value specified by the [[options|editurl]] option. **extraparas** are additional parameters passed to the server. Data is posted in the form  id=rowid&​name=value...,​ where the name is the "​name"​ from [[colmodel_options|colModel]].|+|saveRow|rowid,​\\ callback,\\ url,\\ extraparams\\ |none?​|Saves the row specified by **rowid**, after it has been opened for editing mode by the editRow method. **callback** is a function called after the save is complete. The function accepts an XMLHttpRequest object with the response from the server. **url** is the URL used to submit the values. If specified, this value overrides the value specified by the [[options|editurl]] option. **extraparas** are additional parameters passed to the server. Data is posted in the form  id=rowid&​name=value...,​ where the name is the "​name"​ from [[colmodel_options|colModel]].|
 |setCaption|caption|jqGrid object|Sets a new caption of the grid. If the Caption layer was hidden, it is shown.| |setCaption|caption|jqGrid object|Sets a new caption of the grid. If the Caption layer was hidden, it is shown.|
 |setCell|rowid,​\\ colname, \\ data, \\ class, \\ properties, \\ forceup|jqGrid object|This method can change the content of particular cell and can set class or style properties. Where: \\ //rowid// the id of the row, \\ //colname// the name of the column (this parameter can be a number (the index of the column) beginning from 0 \\ //data// the content that can be put into the cell. If empty string the content will not be changed \\ //class// if class is string then we add a class to the cell using addClass; if class is an array we set the new css properties via css \\ //​properties//​ sets the attribute properies of the cell, \\ //forceup// If the parameter is set to true we perform update of the cell instead that the value is empty | |setCell|rowid,​\\ colname, \\ data, \\ class, \\ properties, \\ forceup|jqGrid object|This method can change the content of particular cell and can set class or style properties. Where: \\ //rowid// the id of the row, \\ //colname// the name of the column (this parameter can be a number (the index of the column) beginning from 0 \\ //data// the content that can be put into the cell. If empty string the content will not be changed \\ //class// if class is string then we add a class to the cell using addClass; if class is an array we set the new css properties via css \\ //​properties//​ sets the attribute properies of the cell, \\ //forceup// If the parameter is set to true we perform update of the cell instead that the value is empty |
Line 118: Line 118:
 |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'​.| |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,​\\ shrink|jqGrid object|Sets a new width to the grid dynamically. The parameters are: \\ //​new_width//​ is the new width in pixels.\\ //shrink (true or false)// has the same behavior as shrinkToFit - see [[options]]. If this parameter is not set we take the value of shrinkToFit.| |setGridWidth|new_width,​\\ shrink|jqGrid object|Sets a new width to the grid dynamically. The parameters are: \\ //​new_width//​ is the new width in pixels.\\ //shrink (true or false)// has the same behavior as shrinkToFit - see [[options]]. If this parameter is not set we take the value of shrinkToFit.|
-|setLabel| colname, \\ data, \\ class, \\ properties|jqGrid object|Sets a new label in the header for the specified column; can also set attributes and classes . The parameters are: \\ //colname// the name of the column (this parameter can be a number (the index of the column) beginning from 0 \\ //data// the content that can be put into the label. If empty string the content will not be changed \\ //class// if class is string then we add a class to the label using addClass; if class is an array we set the new css properties via css \\ //​properties//​ sets the attribute properies of the label|+|setLabel| colname, \\ data, \\ class, \\ properties|jqGrid object|Sets a new label in the header for the specified column; can also set attributes and classes . The parameters are: \\ //colname// the name of the column ​from colModel(this parameter can be a number (the index of the column) beginning from 0 \\ //data// the content that can be put into the label. If empty string the content will not be changed \\ //class// if class is string then we add a class to the label using addClass; if class is an array we set the new css properties via css \\ //​properties//​ sets the attribute properies of the label|
 |setRowData|rowid,​\\ data, \\ cssprop|true on success, \\ false otherwise|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. \\ If the cssprop parameter is string we use addClass to add classes to the row. If the parameter is object we use css to add css properties. Note that we can set properties and classes without data, in this case we should set data to false \\ <color red>Do not use this method when you are editing the row or cell. This will set the content and overwrite the input elements.</​color>​ \\| |setRowData|rowid,​\\ data, \\ cssprop|true on success, \\ false otherwise|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. \\ If the cssprop parameter is string we use addClass to add classes to the row. If the parameter is object we use css to add css properties. Note that we can set properties and classes without data, in this case we should set data to false \\ <color red>Do not use this method when you are editing the row or cell. This will set the content and overwrite the input elements.</​color>​ \\|
 |setSelection|rowid,​\\ onselectrow|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.| |setSelection|rowid,​\\ onselectrow|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.|

QR Code
QR Code wiki:methods (generated for current page)