View Full Version : How to select a record of a treepanel with the record id ?
17 Sep 2012, 5:33 AM
I would like to select a record of a tree panel with the record id. Is it possible?
I have that (doesn't work):
treePanel.getStore().getById(id) is undefined whereas the id is correct.
17 Sep 2012, 5:44 AM
Is that the String ID that you are passing it?
If so you need to change it to number as it expects a number in place of Id
17 Sep 2012, 6:05 AM
I don't think this is the problem, because
id = record.data.fil_id
17 Sep 2012, 11:46 PM
The problem persist. I've read several things in the docs, but there is not much methods that returns a model. I say model, because the select method either take a model or an index. And I don't want an index because the tree is supposed to be closed, and open itself to the concerned directory.
18 Sep 2012, 11:26 PM
19 Sep 2012, 12:27 AM
You should use getNodeById() instead of getById():
19 Sep 2012, 12:32 AM
That's working ! Thanks !
By the way do you know how can I open the treestore to the selected record?
EDIT: Get it :
Powered by vBulletin® Version 4.1.5 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.