2011-09-29 85 views
0

我一直在尝试与jqGrid的4.1.2过去几天,激活更多的它的建成在沿途的功能。一路上,寻呼机停止工作,我无法弄清楚什么是错误的。当网格加载时,我可以看到第一页的数据正常,但是当我切换页面时,数据保持不变。只有柜台改变了。如果我在行数下拉列表中选择100,则可以看到所有数据。jqGrid的寻呼机停止工作

我相比的例子在http://www.trirand.com/blog/jqgrid/jqgrid.html,一切似乎匹配,不过我承认,我不是最好的JavaScript编码器存在。这里是有问题的代码:

<script type="text/javascript" language="javascript"> 
jQuery(document).ready(function() { 
    jQuery("#testgrid").jqGrid({ 
     url:'/Main/DynamicGridData/', 
     mtype:'POST', 
     datatype:'json', 
     colNames: [ 
      'CustomerId', 
      'RecordStartUtc', 
      'RecordEndUtc', 
      'Id', 
      'Name', 
      'Status', 
      'AudioTitle', 
      'ServerId', 
      'ServerName', 
      'ApplicationInstanceId', 
      'ApplicationInstanceName', 
      'ApplicationName', 
      'ChannelId', 
      'ChannelFullName', 
     ], 
     colModel: [ 
      { name: 'CustomerId', index: 'CustomerId', width: 0, align: 'left' }, 
      { name: 'RecordStartUtc', index: 'RecordStartUtc', width: 0, align: 'left' }, 
      { name: 'RecordEndUtc', index: 'RecordEndUtc', width: 0, align: 'left' }, 
      { name: 'Id', index: 'Id', width: 0, align: 'left' }, 
      { name: 'Name', index: 'Name', width: 0, align: 'left' }, 
      { name: 'Status', index: 'Status', width: 0, align: 'left' }, 
      { name: 'AudioTitle', index: 'AudioTitle', width: 0, align: 'left' }, 
      { name: 'ServerId', index: 'ServerId', width: 0, align: 'left' }, 
      { name: 'ServerName', index: 'ServerName', width: 0, align: 'left' }, 
      { name: 'ApplicationInstanceId', index: 'ApplicationInstanceId', width: 0, align: 'left' }, 
      { name: 'ApplicationInstanceName', index: 'ApplicationInstanceName', width: 0, align: 'left' }, 
      { name: 'ApplicationName', index: 'ApplicationName', width: 0, align: 'left' }, 
      { name: 'ChannelId', index: 'ChannelId', width: 0, align: 'left' }, 
      { name: 'ChannelFullName', index: 'ChannelFullName', width: 0, align: 'left' }, 
     ], 
     pager:'#gridpager', 
     rowNum:25, 
     rowList:[25,50,75,100], 
     sortname:'Id', 
     sortorder:'Asc', 
     viewrecords:true, 
     imgpath:'/Content/themes/base/images', 
     caption:'Test Grid', 
     autowidth:true, 
     width:'100%', 
     height:'100%', 
     hoverrows:false 
    }); 
    jQuery("#testgrid").jqGrid(
     'navGrid','#gridpager', 
     {view:true,edit:false,add:false,del:false},{},{},{}, 
     {multipleSearch:true,multipleGroup:false},{closeOnEscape:true} 
    ); 
}); 

</script> 

<table id="testgrid"></table> 
<div id="gridpager"></div> 

由于提前, //莱纳斯

回答

0

不在测试你的代码,但尝试改变你的“排序顺序”值“升序”,以小写的地方。

如果要实现服务器端分页,然后添加该属性:

loadonce:假的;

裁判:http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options

您的服务器端代码同样测试,如果该请求即将在第二页了!

+0

的loadonce财产的伎俩。非常感谢! –