2 Replies Latest reply on Sep 16, 2010 1:28 AM by carstephun

    using selectedItemsCompareFunction

    carstephun Level 1

      Hi there,

       

      I have two datagrids both filled with items (n:m relationship between the items of the datagrids )

      My aim is when I doubleclick on one of the datagrid I want to select those that are bound to the other one, I achive that with an extra field which contains the field values in a coma separated list (string). I did created an array that keeps this coma separated list of items and created a selectedItemsCompareFunction which deals with this. How to trigger the selectedItemsCompareFunction?

       

      
      private var compareCIArray:Array = [];
      
      
      
                     protected function gridVehicleFeatures_doubleClickHandler(event:MouseEvent):void
                     {
                          // ...
                               compareCIArray = (event.target.toolTip as String).split(',');
      //                         complexVehicleFeature.carIndexList.dispatchEvent( new CollectionEvent( CollectionEvent.COLLECTION_CHANGE ) );
                               gridCarIndexes.???
                          }
                     }
      
      
      
      
      
      private function compareVFtoVMF(itemInDataProvider:Object, itemInSelectedItems:Object):Boolean
      {
           var l:Number = compareCIArray.length;
           for( var i:Number=0;i<l;i++)
           {
                if ( itemInDataProvider.desc == compareCIArray[i] )
                {
                     return true;
                }
           }
           return false;
      }
      
      
      
      

       

      r. Sandor