开发者

How i can retrieve value from selected node on Tree Panel

开发者 https://www.devze.com 2023-03-11 04:44 出处:网络
I use following methods : var myobj = myTree.getSelectionModel().getSelection(); alert(myobj) // [Object object]

I use following methods :

var myobj = myTree.getSelectionModel().getSelection();

alert(myobj) // [Object object]

Now, i don't know what i can do it with this object. I supposed this Object have my value ? But i don't know how to use Object to retrieve values ... !

Thanks a lot开发者_开发百科 :)


First. Looking at the API, I think the method you are talking about is

// DefaultSelectionModel:
var myobj = myTree.getSelectionModel().getSelectedNode();

// MultiSelectionModel:
var myobj = myTree.getSelectionModel().getSelectedNodes();

which returns an object or array of type TreeNode.

Second. I will advice you to use a client side debug tool like FireBug or similar to actually see what you get when calling myTree.getSelectionModel().getSelection(). If the result is a TreeNode item then check the API for information about the different properties.

Hope it helps you :)

0

精彩评论

暂无评论...
验证码 换一张
取 消