EasyUI Forum
April 18, 2024, 08:57:54 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: remote Filter automatic  (Read 3981 times)
reneH
Newbie
*
Posts: 5


View Profile
« on: April 16, 2021, 05:35:14 AM »

Hi,

I am using the datagrid Filter extension in my application.

remoteFilter is activated and works fine.

Is it possible to run "doFilter" method while typing  Huh
It just work, when I have no filter option in selection. I want to "doFilter" with a default option.
However, I still want to be able to choose different options.


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


View Profile Email
« Reply #1 on: April 16, 2021, 04:27:21 PM »

When using the 'remote' mode, you can modify the query params when posing data.
Code:
$('#dg').datagrid({
onBeforeLoad: function(params){
console.log(params)
}
});
You can also call 'addFilterRule' method to add some filter rules before 'doFilter'.
Logged
reneH
Newbie
*
Posts: 5


View Profile
« Reply #2 on: April 19, 2021, 04:11:21 AM »

Thanks for your help  !

But how I get it, that "doFilter" will be executed while typing (or when lost focus) in Filter Column ?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: April 20, 2021, 07:43:33 PM »

Please look at this code. You can attach the input events on the filtering box.
Code:
dg.datagrid('enableFilter', [{
field:'listprice',
type:'numberbox',
options:{
precision:1,
inputEvents: $.extend({}, $.fn.numberbox.defaults.inputEvents, {
blur: function(e){
$.fn.numberbox.defaults.inputEvents.blur(e);
// ...
}
})
},
op:['equal','notequal','less','greater']
}])
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!