Method Name |
Parameters |
Return Value |
Description |
Addjsondata |
Data |
None |
Fill the table with incoming data. Usage: VaR mygrid = jquery ("#" + grid_id) [0]; VaR myjsongrid = eval ("(" + jsonresponse. responsetext + ")"); mygrid. addjsondata (myjsongrid ); Myjsongrid = NULL; Jsonresponse = NULL; |
Addrowdata |
Rowid, Data, position, srcrowid |
Success is true; otherwise, false. |
Insert a new row of data according to the parameter. rowid is the ID of the new row, data is the data of the new row, position is the location of the new row, and srcrowid is the reference location of the new row. Data format: {name1: value1, name2: value2 ...} Name is the name specified in colmodel. |
Addxmldata |
Data |
None |
Fill the table according to the incoming data. Usage: var mygrid = jquery ("#" + grid_id) [0]; mygrid. addxmldata (xmlresponse. responsexml ); |
Cleargriddata |
Clearfooter |
Jqgrid object |
Clears the data currently loaded from the table. If clearfooter is true, this method deletes the data in the last row of the table. |
Delrowdata |
Rowid |
Success: true; otherwise, false. |
Deletes a row based on rowid, but does not delete data from the server. |
Footerdata |
Action, Data, format |
Jggrid object |
Set or obtain the bottom data. Action: "Get" or "set". The default value is "get". If it is "get", the return value is name: value, and name is the name in colmodel. If it is set, the value is name: value, and name is the name in colmodel. Format: The default value is true. When the value is true, the formatter format value is called when the new value is set. |
Getcell |
Rowid, icol |
Cell content |
Return the content of the specified rowid and icol cell. icol can be either the position index of the current column in colmodel or the name value. Note: you cannot use this method when editing rows or cells. In this case, the returned value is not a changed value, but the original value. |
Getcol |
Colname, returntype, mathoperation |
Array [] or value |
Returns the value of a column. Colname can be the index or name value of the current column in colmodel. Returntype specifies the type of returned data. The default value is false. If the value is false, the returned array only contains the column value. If the value is true, the returned array is an object array in the format of {ID: rowid, value: cellvalue }, ID is the row ID and value is the column value. For example, [{ID: 1, value: 1}, {ID: 2, value: 2}…]. The optional mathoperation values are 'sum, 'avg', and 'Count' |
Getdataids |
None |
Array [] |
Returns the ID of all data in the current grid. |
Getgridparam |
Name |
Mixed Value |
Return request parameter information |
Getind |
Rowid, rowcontent |
Mixed |
If rowcontent is false, the index location of the row is returned. The ID is the row ID. Rowcontent is false by default. If rowconent is true, the row object is returned. If no row is found, false is returned. |
Getrowdata |
Rowid or none |
Array [] |
Return the data of the specified row. The returned data type is name: value, name is the name in colmodel, and value is the value of the column in the row. If no value is found based on rowid, null is returned. This method cannot be used to obtain data in editing mode. It does not obtain the edited value. |
Hidecol |
Colnameor [colnames] |
Jqgrid object |
If the parameter is a column name, this column is hidden. If an array is specified, all specified columns are hidden. Format: ["name1", "name2"] |
Remapcolumns |
Permutation, updatecells, keepheader |
None |
Adjust the display order of table columns. permutation is the order of the current column. If the value is [, 2], the first column is displayed in the second place. If updatecells is true, the cell data is reordered. If keepheader is true, the position of the header data is adjusted. |
Resetselection |
None |
Jqgrid object |
Selecting or reselect row data also works in the multiple-choice mode. |
Setcaption |
Caption |
Jqgrid object |
Set table title |
Setcell |
Rowid, colname, Data, class, Properties |
Jqgrid object |
Change the value of a cell. Rowid: ID of the current row; colname: column name. It can also be a column Location index starting from 0. Data: changes the content of cells. If it is empty, it is not updated. class: if it is a string, the addclass method will be used to add it to the CSS of the cell, if it is an array, it will be directly added to the style attribute; properties: Set the cell attribute |
Setgridparam |
Object |
Jqgrid object |
Set grid parameters. Some parameter modifications take effect only after the grid is reloaded. This method overwrites the event. |
Setgridheight |
New_height |
Jqgrid object |
The height of the grid can be dynamically changed. You can only set the height of a cell, but not the height of a table. New_height: pixel value, percentage, or "Auto" |
Setgridwidth |
New_width, shrink |
Jqgrid object |
Dynamically change the table width. New_width: Table width, pixel value; shrink: true or false, same as shrinktofit |
Setlabel |
Colname, Data, class, Properties |
Jqgrid object |
Set a new display name for the specified column. Colname: column name, which can also be the position index of a column, starting from 0; Data: Column Display name. If it is null, It is not modified; class: if it is a string, the addclass method will be used to add it to the CSS of the cell, if it is an array, it will be directly added to the style attribute; properties: Set the label attribute |
Setrowdata |
Rowid, Data, cssprop |
Success true otherwise false |
Update the value of a row. rowid is the row ID. Data Value format: {name1: value1, name2: value2 ...} Name is the name in colmodel; cssprop: if it is a string, it will be added to the CSS of the row using the addclass method. If it is an array or an object, it will be directly added to the style attribute. |
Setselection |
Rowid, onselectrow |
Jqgrid object |
Select or reselect the specified row. If onselectrow is true, the event onselectrow is triggered, and onselectrow is true by default. |
Showcol |
Colname |
Jqgrid |
Show columns. Colname can be an array ["name1", "name2"], but name1 or name2 must be the name in colmodel. |
Trigger ("reloadgrid ") |
None |
Jqgrid object |
Reload the current table and initiate a new request to the server. |
Updatecolumns |
None |
None |
Synchronize the width of a table. When dragging a table, use VaR mygrid = jquery ("# grid_id") [0]; mygrid. updatecolumns (); |