Adding CheckBox in AdvancedDataGrid Tree

788 views
Skip to first unread message

Ravi

unread,
Jul 9, 2008, 4:38:32 AM7/9/08
to Flex India Community
Hi All,

This there any way to add checkbox in the advancedDataGrid tree
control (checkbox only for leat node).
Please help me out in this regard.

Thanks in Advance,
Ravi Thangavel

Sameer

unread,
Jul 9, 2008, 6:41:30 AM7/9/08
to Flex India Community
You can set the itemRenderer on the column for which you want
checkbox.

For a different approach, have a look at -
http://techrays.wordpress.com/2008/02/18/a-3-state-checkbox-in-an-advanceddatagrid-itemrenderer/

-Sameer

vinitha pascal

unread,
Jul 9, 2008, 7:11:34 AM7/9/08
to flex_...@googlegroups.com
Hi Sameer,
 
The link which is given by you is excellent. Can i get the similar functionality done in a different way. I mean i want the "Select All" checkbox in the header. Please send me the sample code for achieving this.
 
Thanks in advance.
Vinitha

 

Venkat Viswanathan

unread,
Jul 9, 2008, 2:29:32 PM7/9/08
to flex_...@googlegroups.com
Hi Vinitha,

Here it is:

http://www.thegoldhold.com/?p=4

Five minutes of Googling helps! :)

Regards,
Venkat

vinitha pascal

unread,
Jul 10, 2008, 2:04:41 AM7/10/08
to flex_...@googlegroups.com
Thanks alot Venkat :) . I googled but couldnt find..
 
Small question regarding "How to access the control placed in the datagrid column?" The way i am adding the control is given below
 

<mx:AdvancedDataGridColumn

id="RemoveIconColumn" width="20" dataField="ActivityAssignmentDate">

<mx:itemRenderer>

<mx:Component>

<mx:HBox width="280" height="32" paddingLeft="10" paddingTop="2" verticalAlign="middle" visible="false">

<mx:Image id="RemoveIcon" source="images/Dashboard/tooltip-close.gif" click="this.parentDocument.cancelRegistration(data);" visible="false" />

</mx:HBox>

</mx:Component>

</mx:itemRenderer>

</mx:AdvancedDataGridColumn>
My requirement is to show/hide the image in itemRollOver. I am unable to access image control in the itemRollOver event. Please help me in solving this.
 
Thanks in advance.

 

Prakasam

unread,
Jul 11, 2008, 2:27:33 AM7/11/08
to Flex India Community
Hi All,

The link which you gave by Sameer is really good.In that GroupRenderer
is used to add checkboxes which displays for all the nodes. But our
requirement is to add checkbox only for leaf nodes. Based on this
example i have tried alot but couldn't find solution. The point in
GroupRenderer class is, when the createChildren method is triggered
the data object is null. so they is no possible way to find whether it
is parent node or leaf node. If you have idea based on our requirement
please share it.

Thanks and Regards,
Prakasam

vinitha pascal

unread,
Jul 16, 2008, 2:05:46 AM7/16/08
to flex_...@googlegroups.com
Thanks Venkat. The link was very useful. But my requirement is to expose "click" event and "selected" property for the checkbox's to the outside world. I wrote a custom event to expose a click event on datagrid's itemClick event. But how can i expose the selected property passing the row data with it?
 
Any help?

Venkat Viswanathan

unread,
Jul 16, 2008, 1:57:02 PM7/16/08
to flex_...@googlegroups.com
Hi Vinitha,

You can find the row index of the itemRenderer by writing the following code in the creationComplete event of the itemRenderer:

var col:DataGridListData  = DataGridListData(listData);
rowIndex = col.rowIndex;

Store rowIndex as a private variable in the itemRenderer itself and use it while dispatching the event. For checking if the checkbox is selected or not, in the "click" event of the CheckBox, you will get event.target.selected. Use this property along with rowIndex.

Hope this solves your queries.

Regards,
Venkat

Nitin Vaghela

unread,
Jul 17, 2008, 2:43:29 AM7/17/08
to flex_...@googlegroups.com
hi,
 
For this problem,  i think this attachment may be help to you.
 
 
CheckBoxListAndDataGrid.zip
Reply all
Reply to author
Forward
0 new messages