1 Reply Latest reply on Dec 1, 2009 1:02 PM by Prabh Singh

    Using item renderer in datagrid

    rcanulla Level 1

      Hi there,

       

      I am trying to pass boolean data from a VO into a selected property of a checkbox component. Any thoughts on how to do this?

       

                <mx:DataGridColumn headerText="Active" width="60" dataField="active"> <--- need to pass this into  the selected property
                     <mx:itemRenderer>
                          <mx:Component>
                               <mx:Box horizontalAlign="center">
                                    <mx:CheckBox />
                               </mx:Box>
                          </mx:Component>
                     </mx:itemRenderer>
                </mx:DataGridColumn>
      
        • 1. Re: Using item renderer in datagrid
          Prabh Singh

          <mx:itemRenderer>

               <mx:Component>

                    <mx:CheckBox selected="{Number(data.active)==1?true:false}" click="data.active=data.active" textAlign="center"/>

               </mx:Component>

          </mx:itemRenderer>

           

           

          The click event is present to prevent the user form changing the checkbox state. Hope this works for you.