I'm working with lazy loaded TreeGrid (loadDataOnDemand=true) and I try to select a specific node after data are fetched.
The problem is that when I access the Tree from TreeGrid, it does not contain any data.
For example, I've modified LoadOnDemandTreeSample.java from the SmartGWT Showcase to display the length of the data :
http://www.smartclient.com/smartgwt/showcase/#tree_databinding_ondemand
It always return 0.
If employeeTreeGrid.getData() does not contain any record, I'm not able to use method like Tree.find(String fieldNameOrPath).
Any ideas of what I'm doing wrong ?
Maybe there is another approach to select a node once the tree is drawn?
Thanks for your help.
Cedric
The problem is that when I access the Tree from TreeGrid, it does not contain any data.
For example, I've modified LoadOnDemandTreeSample.java from the SmartGWT Showcase to display the length of the data :
http://www.smartclient.com/smartgwt/showcase/#tree_databinding_ondemand
Code:
employeeTreeGrid.addDataArrivedHandler(new DataArrivedHandler() { public void onDataArrived(DataArrivedEvent event) { SC.logWarn("onDataArrived: " + employeeTreeGrid.getData().getData().length); } }); employeeTreeGrid.addDrawHandler(new DrawHandler() { public void onDraw(DrawEvent event) { SC.logWarn("onDraw: " + employeeTreeGrid.getData().getData().length); } });
If employeeTreeGrid.getData() does not contain any record, I'm not able to use method like Tree.find(String fieldNameOrPath).
Any ideas of what I'm doing wrong ?
Maybe there is another approach to select a node once the tree is drawn?
Thanks for your help.
Cedric
Comment