EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: dayaners on December 02, 2013, 06:48:14 AM



Title: Filter and Virtual Scroll View in one Datagrid
Post by: dayaners on December 02, 2013, 06:48:14 AM
I'm trying to use the filter with Virtual Scroll View, and I'm having trouble picking up the remote data. Explaining ... I have a datagrid which returns me data from the DB which contains a lot of data and I need a filter for only 1 of the fields for my then perform a function. The problem is that when I try to use the filter it can not find the data not yet appeared, which in my case are 20 rows each time q Use the scroll. I need help with the code to filter remotely. ???


Title: Re: Filter and Virtual Scroll View in one Datagrid
Post by: dayaners on December 02, 2013, 07:17:30 AM
i have this for now

index:
    <table id="dgfor" class="easyui-datagrid" title="Selections" style="width:800px;height:400px" 
   data-options="
    view:scrollview,
    pageSize:20,
    url:'show.php',
    iconCls:'icon-ok',
    singleSelect:'true'">
      <thead>
            <tr>
              <th data-options="field:'codforn',width:120">Cod</th>
                <th data-options="field:'name',width:350">Name</th>
              <th data-options="field:'selec',width:100,align:'center'" >Selecionar</th>
            </tr>
      </thead>
   </table>






Js:
$(function(){
         var dg = $('#dgfor').datagrid({remoteFilter:true,url:'teste.filter.php'});
         dg.datagrid('enableFilter', [{
            field:'codforn',
            type:'label'
         },
         {
         field:'name',   
         type:'text',
         op:['contains','equal'],
            },
         {
         field:'selec',
         type:'label',
   
            }]);
      });

and looks like this function overwrite the url of show.php


Title: Re: Filter and Virtual Scroll View in one Datagrid
Post by: stworthy on December 03, 2013, 07:56:42 AM
As your code shows, when do remote filtering, the 'page','rows' and 'filterRules' parameters will be sent to 'teste.filter.php'. Please use firebug tool and switch to 'Network' panel, you will see what parameter values are sent to server.