EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: A-K on August 03, 2015, 12:47:49 AM



Title: Bug in tree and combotree
Post by: A-K on August 03, 2015, 12:47:49 AM
Hey,

There is a bug in the tree and combotree components,
when there is a scroller in the tree, the selected node is not in the length of the node and it looks weird.
The same in the combotree.

Example: http://jsfiddle.net/3L4ej4dx/62/ (http://jsfiddle.net/3L4ej4dx/62/)
Select the node with the text: "Microsoft Officeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" and move the scroller.
Please check it out, Thanks!


Title: Re: Bug in tree and combotree
Post by: A-K on August 05, 2015, 02:38:58 AM
stworthy, any updates on this?

Thanks.


Title: Re: Bug in tree and combotree
Post by: stworthy on August 05, 2015, 06:33:34 AM
Please try this updated example http://jsfiddle.net/3L4ej4dx/68/


Title: Re: Bug in tree and combotree
Post by: A-K on August 05, 2015, 06:43:40 AM
Hey,

It doesnt work well, when there are no rows with long text it looks like this: http://jsfiddle.net/3L4ej4dx/69/ (http://jsfiddle.net/3L4ej4dx/69/)


Title: Re: Bug in tree and combotree
Post by: A-K on August 07, 2015, 03:02:03 AM
stworthy, any patch for this?
The css fix is not the best solution.


Title: Re: Bug in tree and combotree
Post by: stworthy on August 07, 2015, 06:41:18 AM
The alternative solution to solve this issue is to select the node text instead of selecting the whole line. The code below achieves this functionality.
Code:
<script>
(function($){
$(function(){
var css = $('#tree_e_css');
if (!css.length){
var tmp = $('<div class="tree-node-selected"></div>').appendTo('body');
var bc = tmp.css('background-color');
tmp.removeClass('tree-node-selected').addClass('tree-node-hover');
var hc = tmp.css('background-color');
tmp.remove();
$('<style id="tree_e_css">' +
  '.tree-node-selected,.tree-node-hover{background:transparent}' +
  '.tree-node-hover .tree-icon,'+
  '.tree-node-hover .tree-checkbox,'+
  '.tree-node-hover .tree-title{'+
  'background-color:'+hc+
  '}'+
  '.tree-node-selected .tree-icon,'+
  '.tree-node-selected .tree-checkbox,'+
  '.tree-node-selected .tree-title{'+
  'background-color:'+bc+
  '}'+
  '</style>').appendTo('head');
}
});
})(jQuery);
</script>


Title: Re: Bug in tree and combotree
Post by: A-K on August 07, 2015, 06:54:55 AM
Thanks, this solution is the best one yet.

I will use it, but I hope that it will be possible to select the whole row in the next version,
and it will work when the text is short and long.