Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
reload three grids one time
07/01/2009
01:32
Avatar
murdoc
Member
Members
Forum Posts: 23
Member Since:
27/06/2008
sp_UserOfflineSmall Offline

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/01/2009
08:19
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information