Recently in the use of Jqgrid plug-ins, more configuration items,
Here to put a complete example that someone else has already written, click to open the link, the friend who needs to jump to view, http://www.cnblogs.com/miro/p/jqGrid.html
After that, I will summarize some practical problems that I have encountered.
The actual problem encountered:
1. When the page is not required to display, the subsequent data dynamic loading, set the property
Scrollpopup:true,
scroll:1,
page:1,
However, after setting up, want to loadcomplete events in the default selected line, has been selected, and still do not know why, because the table data is not large, and finally had to discard the properties set above.
Loadcomplete:function () {
$ ("#Grid1"). Jqgrid (' SetSelection ', 1, true);
$ ("#Page1_center"). Remove (); }
2. After adding or deleting the operation submitted, let the pop-up box disappear, just set:
Reloadaftersubmit:true,
Closeafteradd:true,
3.jqGrid rebind data, refresh table
$ ("#search"). On ("click", Function () {
$ ("#Grid1"). Jqgrid (' Setgridparam ', {
datatype: ' JSON ',
postdata: Data,
}). Trigger ("Reloadgrid"); Reload
})
4. Sub-IFrame Gets the elements of the upper document
JS notation:
Window.parent.document.getElementById ("Myele");
JQ to be concise:
$ ("#myEle", window.parent.document)
or