4 Replies Latest reply on Mar 19, 2009 1:38 PM by Kalen.Gibbons

    Tree Bug? listItems not being updated when filtering Tree

      Please check out my blog post for an example of the bug and the source code.
      http://www.kalengibbons.com/blog/index.php/2009/01/filtering-a-flex-tree-using-an-arraycol lection/

      The problem is when you open a branch, then filter the Tree, and then try to close the branch. For the example above, here are the steps to recreate:
      1. Expand “Grandma Susan” branch
      2. Expand the “John” branch
      3. Search for “alan”
      4. Collapse the “John” branch

      The error is triggered in the Tree class (expandItem method, line 1775) when it looks for the object in listItems[index][0] and it doesn't exist. It appears that this listItems array is not being updated properly after the filter is applied to the Tree. Any other interaction with the Tree before closing the branch (such as opening a different branch) apparently updates the array and doesn't cause an error.

      How can I get the Tree to update the listItems array after the filter is applied?