I have a view AddActivityView.mxml and in that view is code to display
a list of activies.
I recently added code to hide (isvisible = false) some of the nodes of
the Tree generated by data coming into this view.

The code looks like this...

                        private function 
filterInvisibleNode(item:Object):Boolean {
                        
                                if( item != null && [EMAIL PROTECTED] == 1){
                                       return true;
                                } else {
                                       return false;
                                }
                        }
                        
                        private function get 
filteredCollection():XMLListCollection {
                                var col:XMLListCollection = new 
XMLListCollection(
MyModel.getInstance().activities );
                                //Alert.show(col.toXMLString());
                                col.filterFunction = filterInvisibleNode;
                                col.refresh();
                                return col;
                        }


And the Tree :

        <mx:Tree height="100%" id="actTree"
                        width="100%"
                        dataProvider="{ filteredCollection }"
                        showRoot="false"
                        labelField="@label"
                        borderStyle="none"
                        dragEnabled="true"
                        dragMoveEnabled="false"
                        itemRenderer="com.renderers.ActivityTreeRenderer"
                        toolTip="" />


This seems to work fine for hiding the nodes. However what I'm running
into it this:
the Activities reorder themselves when I click on 1.
For example on load the activies show
Work
Work + 60
Work + 45
Work + 30
Training

If I click on "Work" it goes to the forth item in the list and looks like
Work + 60
Work + 45
Work + 30
Work
Training

Then if I click on Training, that goes to the 4th item in the list..
Work + 60
Work + 45
Work + 30
Training
Work

If I click on Work + 45 it too goes to the 4th item in the list
Work + 60
Work + 30
Training
Work + 45
Work

This is not ideal behavior heh..
What would cause something like this to happen when I click on it?
MyModel.getInstance().activities is populated during the LoginCommand
onResult and looks like

                        if (MyModel.getInstance().employee.isEditor())
                        {
                                var meEvt:CairngormEvent = new
CairngormEvent(MyController.EVENT_GETACTIVITIES);
                                
CairngormEventDispatcher.getInstance().dispatchEvent(meEvt);                    
                        }


Please help me out here! Thanks again!

Reply via email to