0 Replies Latest reply on Jul 1, 2010 5:18 AM by jasenm

    AdvancedDataGrid setStyle on node

    jasenm Level 1

      Hi Guys and Gals

       

      We are trying to have a form of breadcrumping on our category tree. When the user selects a node it underlines the selected node, giving the user some idea of where they have been.

       

      However, when the user  selects a node, some other nodes get the same style aswell without ever selecting them, seemly at random.

       

      ...had been using this to set the style of the current item renderer from the itemClick of the adg.

       

        var itemRenderer = AdvancedDataGrid( event.currentTarget  ).indexToItemRenderer(  AdvancedDataGrid( event.currentTarget  ).selectedIndex );
         itemRenderer.setStyle("textDecoration", "underline")

       

       

      Any other better ways would be much appreciated.

       

       

       

      here is a snippet of the code I had been using:

      private function onItemChange__advancedDataGridTree(event : ListEvent ):void

      {

        var itemRenderer = AdvancedDataGrid( event.currentTarget ).indexToItemRenderer(  AdvancedDataGrid( event.currentTarget ).selectedIndex );
        itemRenderer.setStyle("textDecoration", "underline")

       

      }

       

      <mx:AdvancedDataGrid id="advancedDataGrid__category"
                   showHeaders="false"
                  itemClick="{onItemChange__advancedDataGridTree(event)}"
                   dataProvider="{model.stockModel.groupingCollection}"
                   >
                  <mx:columns>
                      <mx:AdvancedDataGridColumn dataField="label"/>
                  </mx:columns>
      </mx:AdvancedDataGrid>