EasyUI Forum
May 08, 2024, 03:32:18 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: Datagrid row filter - default filterRules not working first remote call  (Read 11348 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: July 01, 2014, 04:56:41 AM »

Working with remote filter and if I define default filterRules for an datagrid, this filter rule not working on the first fetching of data (all data shown).
If I click then the refresh button on pagination the filter works!

Code:
$('#dg').datagrid({
pagination: true,
filterRules: [{
field: 'systemId',
op: 'equal',
value: selectedServerId
}],
        remoteFilter: true,
filterDelay: 1200,

Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: July 01, 2014, 08:48:58 AM »

To solve this issue, please download the updated 'datagrid-filter.js' file from http://www.jeasyui.com/extension/datagrid_filter.php
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #2 on: July 01, 2014, 11:53:37 PM »

Thx, but this don't fix the problem.

Now the filter value is shown in the filter row, but when the page with the datagrid load the first time the data are not filtered!
On remote server side the request parameter of the FilterRules is a null object.

When I refresh the datagrid over the pagination after the first loading, then the data filtered correct.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: July 02, 2014, 12:30:57 AM »

The 'filterRules' parameter value does not sent to server before calling 'enableFilter' method. In order to force the datagrid to do the filter action, please call 'doFilter' method after calling 'enableFilter' method.
Code:
$('#dg').datagrid('enableFilter',...).datagrid('doFilter');
« Last Edit: July 02, 2014, 12:33:37 AM by jarry » Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #4 on: July 02, 2014, 02:57:49 AM »

OK, but I never call "doFilter" direct. This is every time handle by the extension or datagrid. I don't know this.
And it's look like that the datagrid not used the filter when first loading the data by AJAX over the settings

Code:
	pagination: true,
filterRules: [{
    field: 'systemId',
    op: 'equal',
    value: selectedServerId
}],
 
url: 'getEntitiesByCriteriaPagination.do',
queryParams: {
eN: 'dataRecording.racksServer.ServerChangeLog'
},
remoteFilter: true

I mean if the filterRules is init, the datagrid should use this filter when first starting to fetch the data from the remote server over the url!

We will prefilter the data from the database by this field. Like that the datagrid should only show datasets for a special 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!