bjnelson62
7 Nov 2012, 1:20 PM
I have an application where there's a tree on the left, and a grid on the right. I'm allowing the user to delete items in the grid, which all works. I just reload the grid, and all is well.
But updating the tree is another matter. I've tried the following:
1. Collapse the tree node, then remove the children:
treeSel.collapse(
false,
function() {
treeSel.removeAll(true);
},
me);
This doesn't work. As I step through the debugger, I can see that the node is collapsed correctly, but the children are left hanging out in space. Calling removeAll() causes the children to be removed from the screen, but also the plus sign from the parent is also removed with no way to get it back.
2. A variation of #1, in which I call treeSel.collapse();, but also handle afteritemcollapse in the tree and THEN remove the children.
Unfortunately, this works no better. Same result, the plus sign is removed with no way to get it back.
I strongly suspect a bug. The docs say the callback passed to collapse() is called *after* the collapse, but that's not entirely true. Yes it's called after the node is collapsed, but it's not called after the UI is updated after the collapse, which is what I expected. And variation #2 should definitely work.
Is there a way to remove all the children without losing the plus sign? In all the UI frameworks I've worked with, there was always a way to clear out the children such that when the user clicked the plus sign the server would be hit again to fetch the children.
Is there a way to do this in ExtJs?
Thank you,
Brian
But updating the tree is another matter. I've tried the following:
1. Collapse the tree node, then remove the children:
treeSel.collapse(
false,
function() {
treeSel.removeAll(true);
},
me);
This doesn't work. As I step through the debugger, I can see that the node is collapsed correctly, but the children are left hanging out in space. Calling removeAll() causes the children to be removed from the screen, but also the plus sign from the parent is also removed with no way to get it back.
2. A variation of #1, in which I call treeSel.collapse();, but also handle afteritemcollapse in the tree and THEN remove the children.
Unfortunately, this works no better. Same result, the plus sign is removed with no way to get it back.
I strongly suspect a bug. The docs say the callback passed to collapse() is called *after* the collapse, but that's not entirely true. Yes it's called after the node is collapsed, but it's not called after the UI is updated after the collapse, which is what I expected. And variation #2 should definitely work.
Is there a way to remove all the children without losing the plus sign? In all the UI frameworks I've worked with, there was always a way to clear out the children such that when the user clicked the plus sign the server would be hit again to fetch the children.
Is there a way to do this in ExtJs?
Thank you,
Brian