EasyUI Forum

General Category => General Discussion => Topic started by: kingor2001 on November 09, 2014, 10:11:48 PM



Title: Tree need a highlight method
Post by: kingor2001 on November 09, 2014, 10:11:48 PM
In a tree, executing select(target) method will trigger the onSelect event. It's useful that adding a method named highlight(target) which only select a node without triggering the onSelect event. Thks.


Title: Re: Tree need a highlight method
Post by: stworthy on November 10, 2014, 07:36:46 AM
It is easy to extend the 'highlight' method.
Code:
$.extend($.fn.tree.methods, {
highlight: function(jq, target){
return jq.each(function(){
$(this).find('.tree-node-hover').removeClass('tree-node-hover');
$(target).addClass('tree-node-hover');
})
}
})