1 Reply Latest reply on Apr 5, 2011 10:58 PM by Benoitcn

    ItemRenderer issue

    Benoitcn Level 1

      I create a itemrenderer for a list. They stacked display.

      How can set the itemrenderer which clicked by user to the first in the list that user can see all the content of the itemrenderer.

      I mean how can change the itemRenderer depth in a list ?

      I try to control this in itemrenderer click handler:

       

       

                              protected function itemrenderer_clickHandler(event:MouseEvent):void
                     {
                          trace( "clicked" );
                          if( currentState == 'selected' ){
                               currentState = 'normal';
                               parent.setChildIndex(this, deepInList);
                          }else{
                               currentState = 'selected';
                               deepInList = parent.getChildIndex(this);
                               parent.setChildIndex(this, parent.numChildren-1);
                          }
                               }     
      
      
      Error: DataGroup manages its own display objects, and you should not call setChildIndex() directly. To add, remove, or swap items, modify the dataProvider.
           atspark.components::DataGroup/setChildIndex()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\DataGroup.as:1886]
           atcom.renderer::MagnifierIR/itemrenderer_clickHandler()[D:\Flex\flex projects\TheERP\src\com\renderer\MagnifierIR.mxml:77]
           atcom.renderer::MagnifierIR/___MagnifierIR_ItemRenderer1_click()[D:\Flex\flex projects\TheERP\src\com\renderer\MagnifierIR.mxml:9]