Yes, it does set the state based on passed in item data.  I got it to work
now by assigning each of the object into a new arraycollection and reassign
it back to the original.

Thanks Tracy.


On 5/2/07, Tracy Spratt <[EMAIL PROTECTED]> wrote:

   Does your itemRenderer override the set data() function and set the
state of the checkbox based on the passed in item data?



Tracy


 ------------------------------

*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *nhid
*Sent:* Tuesday, May 01, 2007 5:44 PM
*To:* flexcoders@yahoogroups.com
*Subject:* Re: [flexcoders] DataGrid CheckBox itemRenderer select all



Hi all,



I have code similiar to this, where it checks all the checkboxes when I
click on a button Check All and unchecks all when I click on Uncheck All.



However, after I sort any of the columns in the datagrid, clicking Check
All will miss 1 or more boxes, then when I click on Uncheck All, the
currently checked boxes unchecks and the missed boxes become checked.



Any ideas?  Thanks.


*************

<mx:DataGridColumn dataField="Check" itemRenderer="CheckRenderer"
headerText="Option ">

private function checkAll():void
{
   var obj:Object = new Object();

   for (var i:int = 0; i < dg.dataProvider.length; i++) {
       obj= dg.dataProvider[i];
       obj.Check = true;  // = false for uncheckAll()
       dg.dataProvider.itemUpdated(obj);
   }
}




On 10/17/06, *Tommy Mestdagh* <[EMAIL PROTECTED]> wrote:

> I also need to be able to check which CheckBoxs are selected



This is wath you are looking for.  I have a grid with a column named
"deleted" .  By clicking the checkbox you mark the item to delete (webmail
style)

This method pushes all marked items from the grid into a new array
todelete.

all items in the array todelete will be deleted later on.



Good luck .

  Tommy









private function collectForDelete():Array{
   var todelete:Array = new Array();
   var obj:Object = new Object();



 for (var i:Number =0  ; i < table_grids.datagrid.dataProvider.length ; i
++){
    obj = table_grids. datagrid.dataProvider[i];
    if (obj.deleted)  {
     var record:RecordDTO = new RecordDTO();
   record.setColumns(obj);
       todelete.push( record );
   }
    }
return todelete;
}


 ------------------------------

*Van:* flexcoders@yahoogroups.com [mailto: [EMAIL PROTECTED] *Namens
*Chad Callahan
*Verzonden:* dinsdag 17 oktober 2006 16:52
*Aan:* [EMAIL PROTECTED] ups.com
*Onderwerp:* [flexcoders] DataGrid CheckBox itemRenderer select all



I have a DataGrid and the first column's item renderer is mx.controls.CheckBox.
I would like to be able to have a select all button that sets all of the
CheckBox selected = true.  I also need to be able to check which CheckBoxs
are selected.  Any suggestions?





 CHAD CALLAHAN
PROGRAMMER

T8DESIGN.COM <http://t8design.com/>| P 319.266.7574 - x195 | 877.T8IDEAS |
F 888.290.4675




This e-mail, including attachments, is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and may
be legally privileged. If you are not the intended recipient, you are hereby
notified that any retention, dissemination, distribution, or copying of this
communication is strictly prohibited. Please reply to the sender that you
have received the message in error, and then please delete it. Thank you.
 ------------------------------







<<inline: image001.jpg>>

Reply via email to