1 Reply Latest reply on Aug 18, 2011 9:30 AM by Shongrunden

    Playing with the spark datagrid

    nikos101 Level 2

      I'm Playing with the spark datagrid and have a column set up like so:

       

      <GridColumn  width="140" headerText="Margin" headerText.editMode="Margin (editing)" dataField="margin" editable="false"  editable.editMode="true" itemRenderer="gridColumnRenderer" >
                 </GridColumn>

       

      I would like the item render to change colour based on the state of the outerDocuent, is this possible?

       

      I tried this but can't get to the outerdocument

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
                      autoDrawBackground="true">
         
          <s:Label text="{data.margin}" backgroundColor="{   outerDocument.currentState =='editMode'?0xffffff:0xdddddd}"/>
         
      </s:ItemRenderer>