EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: GUOSAI on August 06, 2015, 01:44:31 AM



Title: pagination doesn't work with datagrid-filter
Post by: GUOSAI on August 06, 2015, 01:44:31 AM
when I use datagrid-filter,the function of pagination does not work.altough  I click the button
,the datagrid will not send a request to server.

Thanks for your help.
Js Code
 $('#approvalWorkLoadGrid').datagrid({
      remoteFiletr:true,
      onLoadSuccess:function(Data){
                 globelApprovalWorkLoadTotal = Data.total;
                }
     });
      $("#approvalWorkLoadGrid").datagrid('enableFilter',[{
           field:'approvalCode',
           type:'numberbox',
           options:{precision:2},
           op:['equal','notequal','less','greater']
            }]);
JSP Code
 <div title="呈批件审核量">
    <div id="approvalWorkLoadToolBar">
                 呈批类型:<select id="approvalWorkLoadApprovalType" name="approvalWorkLoadApprovalType" data-options="valuefield:'id',textfield:'text',panelHeight:'auto'" class="easyui-combobox" style="width:150px;height:20px;"></select>
     <a id="approvalWorkLoadQueryBtn" plain="true" href="javascript:approvalWorkLoadQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
        <a id="approvalWorkLoadExportBtn" plain="true" href="javascript:approvalWorkLoadExport();" class="easyui-linkbutton" data-options="iconCls:'icon-excel'">导出</a>
    </div>
    <table id="approvalWorkLoadGrid"  data-options="fit:true,rownumbers:true,singleSelect:true,
     remoteSort:false,border:false,sortable:true,url:'workloadQuery_findApprovalWorkLoad.do',toolbar:'#approvalWorkLoadToolBar',
     pagination:true,pageSize:10,pageList:[10,20,30,50]">
     <thead>
      <tr>
       <th data-options="field:'approvalCode',width:100" sortable="true" halign="left" align="left">呈批编号</th>
       <th data-options="field:'projectName',width:300,formatter: linkedit" sortable="true" halign="left" align="left">项目名称</th>
       <th data-options="field:'approvalTypeName',width:120" sortable="true" halign="left" align="left">呈批类型</th>
       <th data-options="field:'creator',width:120" sortable="true" halign="left" align="left">创建人</th>
       <th data-options="field:'reviewer',width:120" sortable="true" halign="left" align="left">审核人</th>
      </tr>
     </thead>
    </table>
   </div>


Title: Re: pagination doesn't work with datagrid-filter
Post by: jarry on August 06, 2015, 06:09:13 AM
You used a wrong property name 'remoteFiletr', please use 'remoteFilter' instead.
Code:
$('#approvalWorkLoadGrid').datagrid({
      remoteFilter: true,
      //...
});


Title: Re: pagination doesn't work with datagrid-filter
Post by: GUOSAI on August 06, 2015, 06:18:05 AM
thanks a lot! I solved the problem with your help.


Title: Re: pagination doesn't work with datagrid-filter
Post by: GUOSAI on August 06, 2015, 06:37:45 AM
I also have a question.when I add the attribute 'remoteFilter'.The datagrid can hardly be filtered In front .The datagrid always send a request to server with param 'filterRules'.Then I have to filter data backstage。pagination does work well.
when I not add the attribute 'remoteFilter'.The datagrid will not send a request to server ,but the pagination doesn't work.How can I solve this problem??