1 Reply Latest reply on Jun 19, 2009 6:48 AM by leybniz

    checkbox label in datagrid

    vachik79

      Hi, I'm completely new to flex and stuck witht this simple problem. I want to set the labels for checkboxes from the array

       

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
         <mx:Script>
         <![CDATA[
            import mx.collections.*;
            private var gridData:Array = [
               {Label:'Label 1', Checked:false},
               {Label:'Label 2', Checked:true}
               ];       
          
         ]]>
         </mx:Script>

       

         <mx:DataGrid id="myGrid" width="200" height="200"  dataProvider="{gridData}" >
            <mx:columns>       
               <mx:DataGridColumn dataField="Checked">
                  <mx:itemRenderer>
                      <mx:Component>
                          <mx:CheckBox label="{how to get the value from the array?}"></mx:CheckBox>             
                      </mx:Component>
                  </mx:itemRenderer>      
               </mx:DataGridColumn>
            </mx:columns>
         </mx:DataGrid>
      </mx:Application>

       

      would you please help with that?