网格无法加载数据和页面导航无法正常工作

时间:2013-03-27 04:23:19

标签: javascript jquery ajax servlets jqgrid

网格无法从servlete和页面导航加载数据不起作用但是当make“loadonce:false”网格加载但没有页面导航时 -

                jQuery("#list").jqGrid({
                url:'JQGridServlet?action=fetchData',
               datatype: "xml",
                height: 550 ,    
                width:840,                                                      //    'B2C'           'AD''AC'                   
                colNames:['srNo','DNO','C_Id','Customer_Name','FR','PA','mty','Act','Location','Detail_Address'],
                colModel:[
                           // {name:'act1',index:'act1', width:20,sortable:false},
                          {name:'srNo',index:'srNo', width:35,sortable:true,editable:false,hidden:true},
                          // {name:'delboy',index:'delboy', width:35,sortable:true,editable:false},
                          {name:'DNO',index:'DNO', width:33,sortable:true,editable:false,editoptions: { readonly: 'readonly' },focus:false},

                          {name:'FR',index:'FR', width:25,sortable:false,editable:true,editrules:{number:true}},
                          {name:'PA',index:'PA', width:25,sortable:false,editable:true,editrules:{edithidden:true,number:true}},
                          {name:'mty',index:'mty', width:25,sortable:false,editable:true,editrules:{edithidden:true,number:true}},
                          {name:'act',index:'act', width:13,sortable:false},
                          {name:'Location',index:'Location', width:50,sortable:false},
                       {name:'Detail_Address',index:'Detail_Address',width:150,sortable:false
                            }
                        ],
                  paging: true,
                  rowNum:50,
                  rowList:[50,100,150],
                  pager: $("#page"),
                  sortname: 'DNO',
                  sortorder: 'asc',
                  sortable: true, 
                  footerrow: true,
                  userDataOnFooter: true,
                  //loadonce:true,
                  viewrecords:true,
                  gridview: true,
                  altRows : true,
                 onSelectRow : function(id)
                {
                    if (id && id !== lastsel) 
                    {
                       // alert(parseInt(id)+1);
                        DNO = $('#list').getCell(id,'DNO');
                        jQuery("#list").jqGrid('setGridParam',{editurl: 'JQGridServlet?action=Edit&DNO='+DNO});
                        jQuery('#list').saveRow(lastsel, true, 'clientArray');
                        jQuery('#list').editRow(id, true, null, null);
                        jQuery("#list").jqGrid('restoreRow',lastsel);
                        lastsel = id;
                      } 
                },
//MY servelet code:

if (request.getParameter("action").equals("fetchData")) 
                    {
                         System.out.println("in fetchData");
                    }

但是当“loadonce:true”时,不要进入该行动。 请任何机构建议如何解决这个问题。

0 个答案:

没有答案