EasyUI Forum
May 20, 2024, 08:14:07 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: enableFilter + combotree + onChange  (Read 5544 times)
rezzonico
Full Member
***
Posts: 184


View Profile
« on: September 05, 2016, 02:25:47 AM »

Hi all,

I have a simple datagrid with 3 columns.
I use "enableFilter".
The second column is a combotree, the third column is a combobox.
On both columns I use the "onChange" event but only in the third column this event works correctly.

Please select the following link:
http://195.144.40.170/jeasyui/NNN/index1.html
If you type a letter in the third column in the console.log you will see a text (the onChange event fires).
But if you do the same in the second column nothing appears (the onChange event don't fire).

Thanks in advance for any help.

Regards.
Miche
« Last Edit: September 05, 2016, 02:31:53 AM by rezzonico » Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: September 05, 2016, 08:41:15 AM »

The textbox in combotree only act as a searching box. Inputing chars does not trigger the 'onChange' event. You can override the 'query' function to trigger this 'onChange' event when no tree node is selected.
Code:
var options = {
editable: true,
onChange: function(v){
console.log('onChange:'+v)
},
keyHandler: $.extend({}, $.fn.combotree.defaults.keyHandler, {
query: function(q,e){
var target = this;
var state = $.data(target, 'combotree');
var opts = state.options;
var tree = state.tree;
state.remainText = true;
tree.tree('doFilter', opts.multiple ? q.split(opts.separator) : q);
if (!tree.tree('getSelected')){
$(target).combotree('setValue', q);
}
}
})
};
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!