CheckBox header renderer with HierarchicalCollectionView

Posted by fumeng on Stack Overflow See other posts from Stack Overflow or by fumeng
Published on 2011-01-07T15:43:24Z Indexed on 2011/01/08 10:54 UTC
Read the original article Hit count: 191

Filed under:
|
|

Hi -

I've gotten a checkbox header renderer to work well with flat DPs, but a hierarchical collection view is another story. On click, I want it to select all checkboxes in a given column. Here is my code:

var dp:HierarchicalCollectionView = _dataGrid.dataProvider as HierarchicalCollectionView; var testDp:GroupingCollection = dp.source as GroupingCollection; var rawDp:ArrayCollection = testDp.source as ArrayCollection;

for(var i:int=0 ; i < rawDp.length ; i++){ rawDp[i][_dataField] = cb.selected; }

It selects all checkboxes on the 2nd level of data, but doesn't select the top level of data. What am I missing here? I can't seem to find it.

Any tips are greatly appreciated. Thank you.

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript