EasyUI Forum
May 08, 2024, 09:57:22 AM *
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 - remote filter should not called if no filtervalue changed  (Read 7604 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: June 13, 2014, 06:50:53 AM »

We used the default row filter from type=text and the filter fetch remote data after the delay of 1000
Code:
remoteFilter: true,
filterDelay: 1000

But the filter also fetch remote data if the filter text not changed!
Exsample: Click on the filter textfield and then only navigate in the filtertext, or you select part of filtertext with keyboard arrows.

I have seen in the datagrid-filter.js file, that all key events used to call the doFilter() method!
This should only done if the filter value changed or enter is pressed!

Code:
				input.unbind('.filter').bind('keydown.filter', function(e){
var t = $(this);
if (this.timer){
clearTimeout(this.timer);
}
if (e.keyCode == 13){
_doFilter();
} else {
this.timer = setTimeout(function(){
_doFilter();
}, opts.filterDelay);
}
});


I think this shoud be done only when the filter value changed
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 13, 2014, 08:40:46 AM »

You can override the $.fn.datagrid.defaults.defaultFilterOptions, or 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: June 15, 2014, 11:34:55 PM »

Hello. Now I used the updated 'datagrid-filter.js'.
That works better.

But if no text is in the textbox, the doFilter() methode is every time called if i press any key. So if i go with tab-key from one to the next column filter the remote filter is also called
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!