JqGrid learning notes -- Asynchronous Data Loading Method 1
Last Update:2014-06-24
Source: Internet
Author: User
VarcommonQuery & amp; #39; ../importantInfoReport/pageQueryImportantInfoReport. action? Type0 & amp; #39; jQuery (& quot; # listImportInfoReport & quot ;). jqGrid ({rowNum: 10, typ var commonQuery = '.. /importantInfoReport/pageQueryImportantInfoReport. action? Type = 0 ';
JQuery ("# listImportInfoReport"). jqGrid ({
RowNum: 10,
Type: 'post ',
Pager: '# pagerImportantInfoReport ',
Viewrecords: true,
Multiselect: true,
Width: defagrigridwidth,
Height: defaultGridHeight,
Url: commonQuery,
Datatype: "json ",
JsonReader :{
Root: "dataRows", page: "page", total: "total", records: "records", repeatitems: false, id: "id"
},
ColNames :[
'Id ',
'Event name ',
'Event level ',
'Progress status ',
'Receiving range ',
'Submitted ',
'Submission time ',
'Operation'
],
ColModel :[
{Name: 'id', label: 'id', index: 'id', hidden: true}
, {Name: 'eventname', label: 'event name', index: 'eventname', width: 100}
, {Name: 'state', label: 'event level', index: 'state', hidden: true}
, {Name: 'progress', label: 'progress', index: 'progress', width: 100}
, {Name: 'receiver er ', label: 'receiving range', index: 'receiver er ', width: 150}
, {Name: 'sendd', label: 'submitter ', index: 'sendd', hidden: true}
, {Name: 'createtime', label: 'submission time', index: 'createtime', formatter: 'date', formatoptions: {srcformat: 'Y-m-d H: i: s', newformat: 'Y-m-d H: I: s'}, width: 70}
, {Name: 'action', index: 'action', align: "center", width: 60}
],
Sortname: 'id ',
Sortorder: 'desc ',
GridComplete: function (){
Var ids = jQuery ("# listImportInfoReport"). jqGrid ('getdataids ');
For (var I = 0; I {
Var cl = ids [I];
// Alert (cl );
Var rowdata = jQuery ("# listImportInfoReport"). jqGrid ('getrowdata', cl );
// Instance ID
Var Id = rowdata ["id"];
Be =" ";
Del =" ";
JQuery ("# listImportInfoReport"). jqGrid ('setrowdata', ids [I], {action: be + del });
}
},
OnSelectRow: function (id ){
}
});
JQuery ("# listImportInfoReport"). jqGrid ('navgrie', "# pagerImportantInfoReport ",{
Edit: false, add: false, del: false, multipleSearch: false, search: false
});
From Hurry's column