0 Replies Latest reply on Sep 24, 2009 1:23 PM by fl2009

    How to show DataGrid cell on rollover

    fl2009

      I am new to Flex. I have a DataGrid where I like to hide content of a column and show content of a particular row only on mouse is on the row. I can catch itemRollOver and itemRollOut event on a data grid, but how can I show and hide the content in a cell?

       

      <mx:DataGrid itemRollOver="onItemRollOver(event)" itemRollOut="onItemRollOut(event)" editable="false" dataProvider="{contentList}">

      <mx:columns>

           <mx:DataGridColumn id="dynCol">

                <mx:itemRenderer>
                     <mx:Component>
                          <mx:Text id="xDT" />

                     </mx:Component>
                </mx:itemRenderer>
           </mx:DataGridColumn>
      </mx:columns>
      </mx:DataGrid>

       

      private function onItemRollOver(event: ListEvent): void

      {

           ...

      }

       

      private function onItemRollOut(event: ListEvent): void

      {

           ...

      }

       

      Should I be using an itemRenderer inside a DataGridColumn? Or how can I set/remove text in onItemRollOver() and onItemRollOut()?

      Thanks!