[osflash] CellRenderer part 2
Brian Williams
bwillenator at gmail.com
Sun Feb 25 12:01:21 EST 2007
you need to handle this in the setValue call. The grid will actually reuse
the same instance for different rows of the dataprovider when scrolling.
Note - if the setValue passes in null, you should hide any visual components
in your cell.
On 2/21/07, Merrill, Jason <jason.merrill at bankofamerica.com> wrote:
>
> OK - follow up question - (Flashcoders still down - arggg... sorry - if
> someone knows a better list to ask this on (not forum, not a fan of
> forums) please suggest so)
>
> Anyone know how to immediately set a component's state in a CellRenderer
> cell based on the dataprovider? i.e. As soon as the cell is rendered
> and component is there, if dataProvider says checked, make the checkbox
> in the cell checked. If dataproviders says name:"Boston", set the
> ComboBox in the cell to "Boston" in the cell.
>
> I've tried everything - I thought I could tap into the constructor, but
> the constructor doesn't know what cell is being rendered, and thus I
> cannot grab an index to get a value out of dataprovider. Is there a way
> to know what the current cell is when the cell is constructed? the
> following:
>
> var index_obj = getCellIndex();
> listOwner.dataProvider[index_obj.itemIndex].receiveEmail =
> cb.selected;
>
> Only works later - like when the user clicks a checkbox, but it fails
> during the constructor. What I'm doing is grabbing data from a
> webservice, and I need to pre-set the states of components in datagrid
> cells based on the webservice data.
>
> Thanks!
>
> Jason Merrill
> Bank of America
> Learning & Organizational Effectiveness
>
>
>
>
>
>
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20070225/261a1103/attachment.htm
More information about the osflash
mailing list