EasyUI Forum
November 04, 2025, 08:04:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Filter and Virtual Scroll View in one Datagrid  (Read 12562 times)
dayaners
Newbie
*
Posts: 16


View Profile
« 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. Huh
Logged
dayaners
Newbie
*
Posts: 16


View Profile
« Reply #1 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!