Hello,
I am using tree grid and can get back my initial set of tree data. It loads fine.
I would like to open JUST the data I have brought back. I DO NOT want to have some queries fired off for parentids when I expand the nodes I have gotten. How can I control these "extra queries" that are running?
For example, the following has a number of mysql queries for each node that is found looking for parentid. How can I turn that behavior off while I expand just what getData() gave back?
Evan
public void onDataArrived(com.smartgwt.client.widgets.tree.events.DataArrivedEvent event) {
// the following does expand all the nodes, however it also forces a new query on each leaf node!! not what we wanted
Tree t = treeGrid.getData();
TreeNode nodes[] = t.getDescendants();
for (TreeNode n : nodes) {
// make leaves not be folders so don't expand
int numchildren = n.getAttributeAsInt("numchildren");
if (numchildren == 0) n.setIsFolder(false);
else t.openFolder(n);
}
I am using tree grid and can get back my initial set of tree data. It loads fine.
I would like to open JUST the data I have brought back. I DO NOT want to have some queries fired off for parentids when I expand the nodes I have gotten. How can I control these "extra queries" that are running?
For example, the following has a number of mysql queries for each node that is found looking for parentid. How can I turn that behavior off while I expand just what getData() gave back?
Evan
public void onDataArrived(com.smartgwt.client.widgets.tree.events.DataArrivedEvent event) {
// the following does expand all the nodes, however it also forces a new query on each leaf node!! not what we wanted
Tree t = treeGrid.getData();
TreeNode nodes[] = t.getDescendants();
for (TreeNode n : nodes) {
// make leaves not be folders so don't expand
int numchildren = n.getAttributeAsInt("numchildren");
if (numchildren == 0) n.setIsFolder(false);
else t.openFolder(n);
}
Comment