|
No, you CAN do that, just re-assign the
array to the dataProvider property. That will always force a refresh of the
component. tracy From: So that’s how you do it, one item at a
time. I was hoping for a simple swap out one dataprovider with another
dataprovider like this: celltest.dataProvider = pastdata_array;
with celltest.dataProvider = newdata_array; Then maybe a force an update or use
setDataprovider(newdata). If this is not to be then can someone add
this as enhancement request or put it on a Flex wish list. Thanks for your efforts Tracy and everyone
else. Dan From: Examples are addItem() and
addItemAt(). Search the livedocs for “dataProvider API”: http://livedocs.macromedia.com/flex/15/flex_docs_en/wwhelp/wwhimpl/js/html/wwhelp.htm The key point of this advice is that low
level array methods like push do update the dataProvider, but they do not raise
the events necessary for the DataGrid to update its view. The
dataProvider API methods do emit these events. From: Thanks for your reply and
others so far. I have checked off all your requirements but the last one i.e.
“use the dataProvider API to update the combo box array in the item object in
the dataProvider”. Can you provide some code examplse for just this last part
or does the link provide these details? Again thanks everyone. Dan From: Dan, I don’t recall all the posts to this page
but here is my bit. In the main dataProvider, include the
default options for the combo box in an array property on each item
object. In the cell renderer, where you have access to each item object,
grab the combo box array and assign it to the dataProvider of the
ComboBox. I believe there is a full example of this on cflex.net.
Hmm, not exactly what I remembered but here is a possible link: http://www.cflex.net/showfiledetails.cfm?ObjectID=255 If, at run-time, you need to modify the
options of a combobox in a particular cell, use the dataProvider API to update
the combobox array in the item object in the dataProvider. This should
automatically cause the cellRenderer to update the cell with the new combobox
options. If I have lost track of this thread
completely, ignore this post. From: I don’t think I can do event handler
functions for other components inside ComboBoxCellRender itself. Can I have a show of hands of people who
made their Dataproviders dynamic for comboboxes inside a cellrender? Can’t I just setDataprovider? From: You should adjust the data of the item
itself and then have the cell renderer read out of that item (or maybe you’ll
need some form of indirection if you don’t want to edit the item).
Basically you need to do this work in the ComboBoxCellRenderer itself, you
cannot do it from the outside and point in. From: I want to change the data in
the cell’s comboBox to other database YAHOO! GROUPS LINKS
|
- RE: [flexcoders] ComboBoxCellRenderer question Tracy Spratt
- RE: [flexcoders] ComboBoxCellRenderer question Tracy Spratt

