tags: jqGrid
Generally speaking, there are three main methods for assigning values to jqGrid.
// dataSrc is the data source defined in the background or other ways
$("#xxx").jqGrid({
data: dataSrc,
datatype: 'local',
editurl:'clientArray',
cellEdit:true,
cellsubmit:'clientArray',
colNames: colObj[0],
colModel: colObj[1],
height:"150px",
width:"850px",
multiselect:false,
regional: 'ja',
});
This method actually changes the controldata source, So you will needreloadGrid, The new information can be displayed on the page. The advantage is that if your grid is not only used for display, but also for modification and other operations, it is very suitable.
$("#xxx")
.jqGrid("clearGridData")
.jqGrid("setGridParam", {
data:dataSrc // The data to be replaced dataSrc
})
.trigger("reloadGrid"); // reload displays new data
// $("#xxx").jqGrid("setGridParam", {data:dataSrc} can also be written as
// $("#xxx").setGridParam({data:dataSrc});
The advantage of this method is that noreloadGrid, In fact, further speaking, it cannotreloadGrid, The data added after reload will disappear on the page, so if your operation needsreloadGridPlaces, this method is not recommended.
$("#xxx").jqGrid("clearGridData");
$("#xxx")[0].addJSONData(dataSrc);
Method One: once all the data is loaded to the front page and then paged Front page: Focus set in loadoncetrue, JsonReader of repeatitems set true, expressed JqGrid standard format, standard or not. B...
There are two ways to set data in the grid. One is through the addJSONData function. The advantage of this function is that you can directly modify the data globally without refreshing the table. The ...
jqGrid is jQuery's grid widget, the function is relatively complete, and the api document is also complete. At the beginning, test the insert data 100 pens 740ms very smooth 1,000 ...
Pima Indians dataset Obtained from UCI, this is a data set for classification issues that primarily records medical data on whether Indians have diabetes in the last five years. (The data set file is ...
Normal data reading Open() function Open file Parameter 'r' readable 'r' writable read() Reads the data of an open file as a string write() Save to an opened file as a string replace() replaces the da...
Request page flow: enter URL, request controller -> return to view(Browser page = view), The browser parses the display page Display page composed of html, css, js = view, view does n...
1. Sort directly through SQL statements, such as modifying the data set SQL statement as: 2. Realize the sorting effect by setting the advanced properties of the data column. Select the cell with the ...
If the datatype of jqgrid's own search is non-local, then the search parameters will be passed in during the search, and then passed in to the address corresponding to the url for access. jqgrid itsel...