Problem capturing event from external itemRenderer with DataGrid.

1 view
Skip to first unread message

Sudhakar

unread,
Sep 20, 2011, 8:45:41 AM9/20/11
to HyderabadFX

Hi every one,

I am creating a DataGrid on the fly.
To this DataGrid i am using custom itemRenderer to display checkbox.

Problem:
I am unable to catch the check/uncheck the checkbox from out side the
custom itemRenderer.

Code:

// Creating DataGrid Column:
var column:DataGridColumn = new
DataGridColumn( dataField );
column.headerText = "Submit";
column.draggable = false;
column.sortable = false;
column.headerWordWrap = true;
column.editable = false;
column.width = 90;
column.itemRenderer = new ClassFactory( checkBoxAssignment );


// Custom checkbox itemRenderer ( checkBoxAssignment.mxml ).

<?xml version="1.0" encoding="utf-8"?>
<mx:CheckBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalCenter="0" verticalCenter="0" paddingLeft="37" >
<mx:Script>
<![CDATA[

import mx.controls.Alert;
import mx.controls.dataGridClasses.DataGridListData;

[Bindable] private var formattedValue:Boolean;

override public function set data(value:Object):void
{
super.data = value;
formattedValue = data[(listData as DataGridListData).dataField];
this.selected = formattedValue;
}

override protected function clickHandler(event:MouseEvent):void
{
super.clickHandler(event);
formattedValue = data[DataGridListData(listData).dataField] =
selected;
}
]]>
</mx:Script>
</mx:CheckBox>

Please help how to resolve my issue.

Reply all
Reply to author
Forward
0 new messages