Advanced DataGrid and CheckBoxes.. how to enable/disable dynamically


i have advanced data grid.  i'm using checkbox itemrenderer in 1 column.  want able enable or disable ability edit check box, based on user's role not known until login process completes.

 

if name column , mycolumn.enabled = false, check box can still check or unchecked user.   appears sort of 'it rendered' problem or something.

 

 

<mx:advanceddatagrid dataprovider="{mydata}"  itemclick="mydg_itemclick(event)"  id="adgmygrid">
        <mx:columns>

            <mx:advanceddatagridcolumn width="10" id="adgcolumn" editable="false" visible="true"  sortable="false"   datafield="mydata" itemrenderer="mx.controls.checkbox" />  
        </mx:columns>
    </mx:advanceddatagrid>

 

using above, assume adgcolumn should not editable.  remains editable, no matter if try set in code or in declaration.  doing wrong?

the column's editable property specifies whether or not grid should switch column's itemrenderer itemeditor when cell in column gets focus.  problem lies in you're using editable control itemrenderer instead of itemeditor.  if want checkbox renderer, disabled can this:

 

<mx:advanceddatagrid dataprovider="{mydata}"  itemclick="mydg_itemclick(event)"  id="adgmygrid">      <mx:columns>           <mx:advanceddatagridcolumn width="10" id="adgcolumn" editable="false" visible="true"  sortable="false"   datafield="mydata" itemeditor="mx.controls.checkbox">                <itemrenderer>                     <mx:component>                          <mx:checkbox enabled="false"/>                     </mx:component>                </itemrenderer>           </mx:advanceddatagridcolumn>      </mx:columns> </mx:advanceddatagrid> 


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts