Flex DataGrid DataChange Event not working -
in code datagrid not fire datachanged event. can me find wrong. code given below.
<mx:datagrid id="userlist" horizontalgridlines="true" horizontalgridlinecolor="0xeeeeee" datachange="datachanged();" editable="true" change="changegrid(event);" width="100%" height="250" bordercolor="#ff0000" borderstyle="solid" borderthickness="1"> <mx:columns > <mx:datagridcolumn datafield="user" editable="false" headertext="user" /> <mx:datagridcolumn datafield="cam" editable="true" width="24" itemeditor="mx.controls.checkbox" editordatafield="cam" textalign="center" headertext="m"> <mx:itemrenderer> <mx:component > <mx:box horizontalalign="center" verticalalign="middle" height="100%" width="100%"> <mx:checkbox id="chb" click="data.cam=!data.cam" selected="{data.cam}"/> </mx:box> </mx:component> </mx:itemrenderer> <mx:headerrenderer> <mx:component> <mx:image width="16" height="16" tooltip="change cam status" source="@embed(source='icons/webcam_start.png')" verticalalign="middle" horizontalalign="center"/> </mx:component> </mx:headerrenderer> </mx:datagridcolumn> <mx:datagridcolumn datafield="mic" editable="false" itemeditor="mx.controls.checkbox" editordatafield="mic" width="24" textalign="center" headertext="c"> <mx:itemrenderer> <mx:component > <mx:box horizontalalign="center" verticalalign="middle" height="100%" width="100%"> <mx:checkbox id="chb1" click="data.mic=!data.mic" selected="{data.mic}" /> </mx:box> </mx:component> </mx:itemrenderer> <mx:headerrenderer> <mx:component> <mx:image width="16" height="16" tooltip="change microphone status " source="@embed(source='icons/microphone_plus.png')" verticalalign="middle" horizontalalign="center"/> </mx:component> </mx:headerrenderer> </mx:datagridcolumn> <mx:datagridcolumn datafield="sound" editable="false" itemeditor="mx.controls.checkbox" editordatafield="sound" width="24" textalign="center" headertext="r1"> <mx:itemrenderer> <mx:component > <mx:box horizontalalign="center" verticalalign="middle" height="100%" width="100%"> <mx:checkbox id="chb2" click="data.sound=!data.sound" selected="{data.sound}"/> </mx:box> </mx:component> </mx:itemrenderer> <mx:headerrenderer> <mx:component> <mx:image width="16" height="16" tooltip="turn sound on/off " source="@embed(source='icons/audio_volume_high.png')" verticalalign="middle" horizontalalign="center"/> </mx:component> </mx:headerrenderer> </mx:datagridcolumn> </mx:columns> </mx:datagrid>
i using following data private var plist:arraylist = new arraylist( [{user:'ravi kanchan sharma', cam:true, mic:true, sound:true}, {user:'vijay anand sharma', cam:true, mic:false, sound:true}, {user:'yogender kumar sharma', cam:false, mic:true, sound:true}]);`
for datachange event fire component, 'data' value needs change. not clear code why datagrid's data value change.
the datachange event used inside itemrenderer modify display contents whenever itemrenderer's data property changed. data property in itemrenderer represent single element of datagrid's dataprovider.
unless using datagrid itemrenderer--which possible unusual--i not expect datagrid's data property change; , therefore datachange event never fire datagrid.
Comments
Post a Comment