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/05 07:34]
tsahi clarify on saveRow
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 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)