Forum


01:32

27/06/2008

I have try to using the following code in ord to reload the three grid ,but only the first grid be reloaded and other two doesn't. Do you know how to reload all of the three grids after one times code excution.
jQuery("#taskEdit").jqGrid({
url:'taskList.php',
datatype:"xml",
colNames:["ID","1Time", "2Time","Desc"],
colModel:[
{name:'TASKID',index:'TASKID', width:100, xmlmap:"TASK_ID",sorttype:"int"},
{name:'TASK_STARTTIME',index:'TASK_STARTTIME', width:180,align:'left',xmlmap:"TASK_START_TIME",sorttype:"date"},
{name:'TASK_ENDTIME',index:'TASK_ENDTIME', width:180, align:'left',xmlmap:"TASK_END_TIME", sorttype:"date"},
{name:'TASKDESC',index:'TASKDESC', width:240,xmlmap:"TASK_DESC"}
],
height:250,
rowNum:10,
rowList:[10,20,30],
editurl:"taskEdit.php",
imgpath: gridimgpath,
viewrecords: true,
xmlReader: {
root : "TaskList",
row: "Task",
repeatitems: false,
id: "TASK_ID"
},
caption: "任务列表",
ondblClickRow: function(id){
$.post("taskEdit.php", { task_id: id},function(data){
jQuery("#ReportDetail").trigger('reloadGrid');
jQuery("#ReportIndex").trigger('reloadGrid');
jQuery("#ReportObject").trigger('reloadGrid')});
}
});
jQuery("#ReportDetail").jqGrid({
url: 'taskEditII.php',
datatype: "xml",
colNames:["act","ID","æè¿°","开始时间","ç»“æŸæ—¶é—´","时段1开始时间",
"时段1ç»“æŸæ—¶é—´","时段2开始时间","时段2ç»“æŸæ—¶é—´","时段3开始时间","时段3ç»“æŸæ—¶é—´","周期",
"是å¦è¾“出","是å¦å¯ç”¨","创建者"],
colModel:[
{name:'act',index:'act', width:60,sortable:false},
{name:"TASK_ID",index:"TASK_ID", width:45,align:"left", xmlmap:"TASK_ID"},
{name:"TASK_DESC",index:"TASK_DESC", width:60, align:"left",editable:true, xmlmap:"TASK_DESC",editoptions:{size:"20",maxlength:"30"}},
{name:"TASK_START_TIME",index:"TASK_START_TIME", width:90,align:"left",editable:true,xmlmap:"TASK_START_TIME",editoptions:{size:"20",maxlength:"30"}},
{name:"TASK_END_TIME",index:"TASK_END_TIME", width:90,align:"left",editable:true,xmlmap:"TASK_END_TIME",editoptions:{size:"20",maxlength:"30"}},
//{name:"STAT_DAYS",index:"STAT_DAYS", width:45,align:"left",editable:true,xmlmap:"STAT_DAYS",editoptions:{size:"20",maxlength:"30"}},
{name:"PERIOD1_START",index:"PERIOD1_START", width:90,align:"left",editable:true,xmlmap:"PERIOD1_START",editoptions:{size:"20",maxlength:"30"}},
{name:"PERIOD1_END",index:"PERIOD1_END", width:100,align:"left",editable:true,xmlmap:"PERIOD1_END",editoptions:{size:"20",maxlength:"30"}},
{name:"PERIOD2_START",index:"PERIOD2_START", width:90,align:"left",editable:true,xmlmap:"PERIOD2_START",editoptions:{size:"20",maxlength:"30"}},
{name:"PERIOD2_END",index:"PERIOD2_END", width:100,align:"left",editable:true,xmlmap:"PERIOD2_END",editoptions:{size:"20",maxlength:"30"}},
{name:"PERIOD3_START",index:"PERIOD3_START", width:90,align:"left",editable:true,xmlmap:"PERIOD3_START",editoptions:{size:"20",maxlength:"30"}},
{name:"PERIOD3_END",index:"PERIOD3_END", width:100,align:"left",editable:true,xmlmap:"PERIOD3_END",editoptions:{size:"20",maxlength:"30"}},
{name:"STAT_CYCLE",index:"STAT_CYCLE", width:45,align:"left",editable:true,xmlmap:"STAT_CYCLE",edittype:"select",editoptions:{value:"0:0;5:5;15:15;30:30;60:60"}},
{name:"REPORT_EXPORT",index:"REPORT_EXPORT", width:45,align:"left",editable:true,xmlmap:"REPORT_EXPORT",edittype:"checkbox",editoptions: {value:"1:-1"}},
{name:"TASK_ENABLE",index:"TASK_ENABLE", width:45,align:"left",xmlmap:"TASK_ENABLE",editable:true,xmlmap:"REPORT_EXPORT",edittype:"checkbox",editoptions: {value:"true:false"}},
{name:"TASK_CREATOR",index:"TASK_CREATOR", width:45,align:"left",editable:true,xmlmap:"TASK_CREATOR",editoptions:{size:"20",maxlength:"30"}}
],
Height:20,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
viewrecords: true,
editurl:"server.php",
loadComplete: function(){
var ids = jQuery("#ReportDetail").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i]; be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=jQuery('#ReportDetail').editRow("+cl+"); ></ids>";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=jQuery('#ReportDetail').saveRow("+cl+"); />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=jQuery('#ReportDetail').restoreRow("+cl+"); />";
jQuery("#ReportDetail").setRowData(ids[i],{act:be+se+ce}) } },
xmlReader: {
root : "TaskInfo",
row: "TaskDetail",
repeatitems: false,
id:"TASK_ID"
},
caption: "任务æè¿°"
});
/********************************************************************************************/
jQuery("#ReportIndex").jqGrid({
url: 'taskEditII.php',
datatype: "xml",
colNames:["æ“作","æŒ‡æ ‡ID","æŒ‡æ ‡å","æŒ‡æ ‡ä¸æ–‡å","详细æè¿°","最大阀值","最å°é˜€å€¼"],
colModel:[
{name:'act',index:'act', width:100,sortable:false},
{name:"INDEXID",index:"ID", width:100, xmlmap:"INDEXID"},
{name:"INDEX_NAME",index:"NAME", width:100, xmlmap:"INDEX_NAME"},
{name:"INDEX_DESC",index:"DESC", width:100,align:"left",xmlmap:"INDEX_DESC"},
{name:"INDEX_LDESC",index:"LDESC", width:100, align:"left",xmlmap:"INDEX_LDESC"},
{name:"THRESHOLD_MAX",index:"THRESHOLD_MAX", width:100,align:"left",editable:true,editoptions:{size:"20",maxlength:"30"},editrules:{edithidden:true,number:true}},
{name:"THRESHOLD_MIN",index:"THRESHOLD_MIN", width:100,align:"left",editable:true,editoptions:{size:"20",maxlength:"30"},editrules:{edithidden:true,number:true}}
],
height:300,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pageredindexList'),
viewrecords: true,
editurl:"server.php",
loadComplete: function(){
var ids = jQuery("#ReportIndex").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i]; be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=jQuery('#ReportIndex').editRow("+cl+"); ></ids>";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=jQuery('#ReportIndex').saveRow("+cl+"); />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=jQuery('#ReportIndex').restoreRow("+cl+"); />";
jQuery("#ReportIndex").setRowData(ids[i],{act:be+se+ce}) } },
xmlReader: {
root : "TaskDetail",
row: "TaskIndex",
repeatitems: false,
id:"INDEXID"
},
caption: "æŒ‡æ ‡åˆ—è¡¨",
//multiselect: true
});
$("#edit5").click(function(){
var gr = jQuery("#ReportIndex").getGridParam("selrow");
if( gr != null ) jQuery("#ReportIndex").editGridRow(gr,{height:280,reloadAfterSubmit:false});
else alert("Please Select Row")});
jQuery("#ReportObject").jqGrid({
url: 'taskEditII.php',
datatype: "xml",
colNames:["æ“作","对象ID","对象å", "是å¦è®¾å€¼", "æè¿°","对象值"],
colModel:[
{name:'act',index:'act', width:100,sortable:false},
{name:"OBJID",index:"ID", width:100, xmlmap:"OBJID"},
{name:"OBJ_NAME",index:"OBJ_NAME", width:200,align:"left",xmlmap:"OBJ_NAME"},
{name:"HAS_VALUE",index:"HAS_VALUE", width:100, align:"left",xmlmap:"HAS_VALUE"},
{name:"OBJ_DESC",index:"OBJ_DESC", width:100,xmlmap:"OBJ_DESC"},
{name:"OBJ_VALUE",index:"OBJ_VALUE", width:100,align:"left",editable:true,editoptions:{size:"20",maxlength:"30"},editrules:{edithidden:true,number:true}}
],
height:300,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
viewrecords: true,
xmlReader: {
root : "TaskDetail",
row: "TaskObject",
repeatitems: false,
id: "OBJID"
},
caption: "对象列表",
//multiselect: true,
editurl:"server.php",
loadComplete: function(){
var ids = jQuery("#ReportObject").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i]; be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=jQuery('#ReportObject').editRow("+cl+"); ></ids>";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=jQuery('#ReportObject').saveRow("+cl+"); />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=jQuery('#ReportObject').restoreRow("+cl+"); />";
jQuery("#ReportObject").setRowData(ids[i],{act:be+se+ce}) } }
/*
onSelectRow: function(id){
if(id && id!==lastsel2){
jQuery('#objectList').restoreRow(lastsel2);
jQuery('#objectList').editRow(id,true);
lastsel2=id;
}
*/
});
08:19

Moderators
30/10/2007

Hello,
Put alert after every trigger to see what is happen.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
54 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66