Ah, cool.  So all that Flash frame stuff might actually be good to know about!

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Friday, December 30, 2005 1:31 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] CheckCellRenderer

 

Naw, it actually calls invalidate each time, so it's only updated once per frame, whether you call it 1, or 1000 times.  That's the beauty of DataProvider API!

 

However, the manual dispatch isn't so bad because for thousands of records, this:

 

my_array[i].cow = "foo";

+ dispatch modelChanged()

 

is faster than editField on thousands of records.  Don't have benchmarks, though.

 

----- Original Message -----

From: Tracy Spratt

Sent: Friday, December 30, 2005 1:24 PM

Subject: RE: [flexcoders] CheckCellRenderer

 

The difference is that edit field will update the UI immediately every time you call it.  This is fine with small data sets.  If you update many items, then there might be a performance issue with so many ui refreshes.

 

Also, you might be able manually dispatch the modelChanged event instead of re-assigning the dataProvider, but I have not tried this.

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rob Dickey
Sent: Thursday, December 29, 2005 11:13 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] CheckCellRenderer

 

Hi Tracy, JesterXL,

 

Thanks for both replies and suggestions.  Both worked great, although I think I’ll stick to the last suggestion (editField) as

It would take more comments then code to explain why I am reassigning the data provider to the grid that it’s already assigned to J

 

Regards,

Rob


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Thursday, December 29, 2005 5:56 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] CheckCellRenderer

 

Example:

dataGrid.dataProvider[i].cbSelect = newState;

becomes:

dataGrid.dataProvider.editField(i, "cbSelect", newState);

----- Original Message -----
From: "Tracy Spratt" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Thursday, December 29, 2005 8:57 PM
Subject: RE: [flexcoders] CheckCellRenderer


This form of update:
dataGrid.dataProvider[i].cbSelect = newState
does not cause the dataProvider to emit the modelChanged event to update
the control.

Instead, use the dataProvider API, like editItemAt().

Or, probably better in your case, when you are done updating the
dataProvider, re-assign it to the control:
Datagrid.DataProvider = DataGrid.dataProvider;

This should cause the proper events to fire and update the screen.

Tracy

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of rb_dickey
Sent: Thursday, December 29, 2005 7:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] CheckCellRenderer

Hi,

I'm trying to do a simple loop through a datagrid to set a column
that's using the CheckCellRenderer to be checked or unchecked but
the following code does not work, well sort of.  What happens is
that if I "mouseover" each row, viola, the checks in the checkbox
appear or disappear depending on my choice to select all or not.
Here is the function I call to set the checkboxes in the grid:

private function selectAll(newState:Boolean):Void
{
for( var i in dataGrid.dataProvider )
dataGrid.dataProvider[i].cbSelect = newState;
}

The datagrid column is defined as:
mx:DataGridColumn headerText="" width="40" columnName="cbSelect"
cellRenderer="CheckCellRenderer" resizable="true"  />

The dataprovider for the grid is an RO...

TIA for any info.
Rob







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to