EasyUI Forum
May 05, 2024, 12:15:16 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 extension lacks an important event  (Read 5618 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: May 10, 2015, 07:57:35 AM »

Hey,

Can you please add an event when the component is filtered? The event should be fired when a user has filtered the component,
and it should return the current rows that are in the component after he has been filtered and also the type of the filter. if it was a free text filter then it should return the current text that was typed.

at this point I can not know when did the user has filtered the component... which makes the filter extension not that helpful.
and making it {remoteFilter: true} is not that helpful because I will need to create all the filters by myself..

Maybe I missed something, would be happy to get some help with this.

Thanks.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 10, 2015, 05:10:01 PM »

When the data is filtered, new rows will be loaded into the datagrid and the 'onLoadSuccess' event fires. You can retrieve the 'filterRules' property value to know what filtering rules are applied to the datagrid.
Code:
$('#dg').datagrid({
onLoadSuccess: function(data){
var opts = $(this).datagrid('options');
console.log(data);
console.log(opts.filterRules)
}
})
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!