EasyUI Forum
September 13, 2025, 04:27:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: how to select a specific node after a tree load on: September 02, 2014, 08:31:13 PM
Please try this:
Code:
$('#tt').tree({
url: "<c:url value='/student/classlist'/>",
method:'get',
onLoadSuccess:function(){
var node = $(this).tree('find', g_node_id);
if (node){
$(this).tree('select', node.target);
}
}
})

Wow, You are a great help! Thanks a lot!
2  General Category / EasyUI for jQuery / how to select a specific node after a tree load on: September 02, 2014, 02:45:40 AM
hi
  I am using the tree control. the following codes does not select the node I want. I guess this is due to the async nature of the tree control: when 'find' method is executed, the tree's data may not arrive yet. I tried other ways such as placing the 'select' method in the formatter function, but none of them seems to work. Do you guys know how to do it? Thanks in advance.

    var g_node_id = 11;
    $('#tt').tree
    ({
      url: "<c:url value='/student/classlist'/>",
      method:'get',
      ...
    });

    var node = $('#tt').tree('find', g_node_id);
    if (node)
      $('#tt').tree('select', node.target);
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!