Hello,
Store.Add fires for all sub nodes when a node is drag and drop to other node level for a TreePanel.

Is there any event to fire only once when Add occurs.

Thanks,

Colin Alworth

3 Mar 2011, 2:59 PM

Unless I am misreading, as of GXT 2.2.0, TreePanelDropTarget, the code that handles a drop into a TreePanel, calls either TreeStore.insert(List, int, boolean) or TreeStore.insert(ModelData, List, int, boolean), and in all cases, that last boolean (named addChildren) is false.

Both of those methods make their way into TreeStore.doInsert, a private method, where addChildren is used to determine if the children of the items being appended should be added themselves (as opposed to the List<TreeModel> named children, which would more aptly be named itemsToAppend or newChildren). If addChildren is false, as it is in these cases, the last block of code where the subelements are recursively appended does not happen, so I am unclear as to how your issue is occurring.

Can you provide a simple example of this, or at least a stack trace that demonstrates that doInsert is being called recursively and causing this issue? I suspect that either an event is occurring as a result of items being added, or that the add call is not coming from within TreePanelDropTarget.

Unless I am misreading, as of GXT 2.2.0, TreePanelDropTarget, the code that handles a drop into a TreePanel, calls either TreeStore.insert(List, int, boolean) or TreeStore.insert(ModelData, List, int, boolean), and in all cases, that last boolean (named addChildren) is false.

Both of those methods make their way into TreeStore.doInsert, a private method, where addChildren is used to determine if the children of the items being appended should be added themselves (as opposed to the List<TreeModel> named children, which would more aptly be named itemsToAppend or newChildren). If addChildren is false, as it is in these cases, the last block of code where the subelements are recursively appended does not happen, so I am unclear as to how your issue is occurring.

Can you provide a simple example of this, or at least a stack trace that demonstrates that doInsert is being called recursively and causing this issue? I suspect that either an event is occurring as a result of items being added, or that the add call is not coming from within TreePanelDropTarget.