flex - Radio button in datagrid for selecting the entire row -
i have datagrid in flex. need add radio button in first column such when select radio button, entire row should selected. have tried using following code -
<mx:datagridcolumn id="selectcolumnradiobutton" sortable="false" textalign="center" editable="false" width="18"> <mx:itemrenderer > <mx:component> <mx:radiobutton selected="false"/> </mx:component> </mx:itemrenderer> </mx:datagridcolumn>
but there following problems - 1) allowing me select multiple buttons. 2) if click anywhere else on row, row getting selected. not expected behavior. if should selected when select radio button.
please me on this. :)
it allowing me select multiple buttons
because radio buttons, being drop-in item renderers, belong different radio-button-groups in different components. write method in parent class (that contains datagrid) takes rowindex input , selects row accordingly , explicitly deselects other radio buttons. can call method drop-in radio button using outerdocument.methodname(listdata.rowindex)
<mx:itemrenderer > <mx:component> <mx:radiobutton selected="false" change="outerdocument.methodname(listdata.rowindex)"/> </mx:component> </mx:itemrenderer>
if click anywhere else on row, row getting selected. not expected behavior.
this default behavior of datagrid
- suggested, you'll have go through datagrid code, figure out part selection happens, , override method. possible behavior implemented in base class of datagrid listbase
.
Comments
Post a Comment