When jquery is added, edit jqGrid (instance code ). For more information, see.
The Code is as follows:
Function showTestSubjectGrid (){
$ ("# TestSubjectGrid"). jqGrid ({
Url :"",
Datatype: "json ",
Height: 215,
Width: 480,
Caption: "Test subjects ",
Autoheight: true,
Autowidth: true,
Scrollrows: false, // whether the row scroll bar is displayed
Multiselect: true, // whether to display the check box
Hidegrid: false, // cancel Grid contraction
PostData :{
StrJson: testsubjectData
},
ColNames: ['', 'test account', 'start time ', 'end time', 'session ',],
ColModel :[
{
Name: 'data ',
Index: 'data ',
Hidden: true
},{
Name: 'display _ content ',
Index: 'display _ content ',
Width: 100,
Editable: true,
Align: 'left'
},{
Name: 'exam _ starttime ',
Index: 'exam _ starttime ',
Width: 110,
Editable: true,
Align: 'center'
},{
Name: 'exam _ endtime ',
Index: 'exam _ endtime ',
Width: 110,
Editable: true,
Align: 'center'
},{
Name: 'exam _ call ',
Index: 'exam _ call ',
Width: 110,
Editable: true,
Align: 'center'
}],
JsonReader :{
Root: "rows ",
Repeatitems: false,
Id: "data"
},
GridComplete: function (){
Var testIds = $ ("# testSubjectGrid"). jqGrid ("getDataIDs ");
For (var I = 0; I <testIds. length; I ++ ){
Var cid = testIds [I];
Var exam_begintime ="";
Var exam_endtime ="";
Var exam_turn ="";
JQuery ("# testSubjectGrid"). jqGrid ('setrowdata', cid, {exam_startTime: exam_begintime });
JQuery ("# testSubjectGrid"). jqGrid ('setrowdata', cid, {exam_EndTime: exam_endtime });
JQuery ("# testSubjectGrid"). jqGrid ('setrowdata', cid, {exam_turn: exam_turn });
$ ("# Exam_begintime _" + testIds [I]). datepicker ({
ShowOn: 'click ',
ButtonText: 'select'
});
$ ("# Exam_endtime _" + testIds [I]). datepicker ({
ShowOn: 'click ',
ButtonText: 'select'
});
}
}
});
};