Note that there are some explanatory texts on larger screens.

plurals
  1. POForcing vertical scrollbar re-calcuation in a hierarchical tree class derived from mx.controls.Tree
    primarykey
    data
    text
    <p>I'm working (for my sins) on a Flex 3.3 project, which unfortunately cannot be upgraded to a newer SDK version at this stage, and have hit an issue with the custom hierarchical tree class (subclassing <code>mx.controls.Tree</code>) we're using. <em>Excuse the spelling; the previous developer had a fear of dictionaries...</em></p> <pre><code>public class HierachyTree extends Tree public function HierachyTree() { super(); iconFunction = itemIconFunc; // etc. } </code></pre> <p>I'm using a solution somewhere between these <a href="http://www.davidarno.org/2009/04/01/how-to-filter-all-nodes-of-a-flex-tree-component/" rel="nofollow">two</a> <a href="http://richardleggett.co.uk/blog/index.php/2009/05/11/filtering-hierachical-data-in-flex-itree" rel="nofollow">methods</a> (basically, implementing <code>ITreeDataDescriptor</code>) in order to add live text filtering to the component, and it's working so far:</p> <pre><code>public class HierachyTreeFilteredDataDescriptor implements ITreeDataDescriptor { private var filter:Function public function HierachyTreeFilteredDataDescriptor(filterFunction:Function) { this.filter = filterFunction; } public function getChildren(node:Object, model:Object=null):ICollectionView { var children:ArrayCollection = new ArrayCollection([]); // Filter the children... return children; } public function hasChildren(node:Object, model:Object=null):Boolean { var treeItem:Object = node as Object; if (! (treeItem is ScenarioMeta)) return (treeItem as Object).children.length &gt; 0; else return false; } </code></pre> <p>The issue is that (with <code>tree:HierachyTree</code>) neither <code>tree.maxVerticalScrollPosition</code> nor the protected property <code>tree.verticalScrollBar.maxScrollPosition</code> updates when the search string is changed.</p> <p>I've tried calling <code>invalidateList()</code> and <code>invalidateDisplayList()</code> on <code>tree</code> — and calling <code>invalidateDisplayList()</code> and <code>invalidateSize()</code> on <code>tree.verticalScrollBar</code> — to no avail.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload