Changes between Version 1 and Version 2 of Ticket #15858, comment 2


Ignore:
Timestamp:
Aug 16, 2012, 10:51:56 PM (7 years ago)
Author:
Peter Jekel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15858, comment 2

    v1 v2  
    11No, the issue is, IMHO, not related to multi-select. The issue is caused by the fact that whenever a parent node is deleted no check is peformed to see if any of its children is a selected item and therefore any selected child remains selected in the context of the _dndSelector. The problem only reveals itself, in the small demo I submitted, when parent C is placed on the tree more than once.
    22
    3 The easiest way of fixing the problem is to modify _dndSelector.getSelectedTreeNodes() as I suggested because it is going to be difficult to check each child when the parent is being deleted just because the node is being destoyed by calling node.destroyRecursive() which is handled by _widgetbase and thus outside the scope of the tree and _dndSelector. Just have _dndSelector.getSelectedTreeNode() verify if any selected node is still valid, it not, deleted it from the list of currently selected items.
     3The easiest way of fixing the problem is to modify _dndSelector.getSelectedTreeNodes() as I suggested because it is going to be difficult to check each child when the parent is being deleted just because the node is being destoyed by calling node.destroyRecursive() which is handled by _widgetbase and thus outside the scope of the tree and _dndSelector. Just have _dndSelector.getSelectedTreeNode() verify if any selected node is still valid, if not, deleted it from the list of currently selected items.
    44
    55I propose the same approach for the second issue I listed with the tree itself (setChildItems()). The fact that a node exists on the 'existingNodes' list does not guarentee the node is still valid when re-used. The current statement:
     
    1010}}}
    1111
    12 will always throw an error if the existingNode has not domNode (e.g. is destroyed), and a domNode is required when calling getParent().
     12will always throw an error if the existingNode has not domNode (e.g. is destroyed), because a domNode is required when calling getParent().
    1313
    1414Hope this explains it a little more.