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.

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of Dan Plesse
Sent: Saturday, October 22, 2005 1:50 AM
To: [email protected]
Subject: RE: [flexcoders] ComboBoxCellRenderer question

 

Tracy,

 

   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: [email protected] [mailto:[email protected]] On Behalf Of Tracy Spratt
Sent: Friday, October 21, 2005 1:49 PM
To: [email protected]
Subject: RE: [flexcoders] ComboBoxCellRenderer question

 

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.

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of Dan Plesse
Sent: Friday, October 21, 2005 11:22 AM
To: [email protected]
Subject: RE: [flexcoders] ComboBoxCellRenderer question

 

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: [email protected] [mailto:[email protected]] On Behalf Of Matt Chotin
Sent: Thursday, October 20, 2005 10:47 PM
To: [email protected]
Subject: RE: [flexcoders] ComboBoxCellRenderer question

 

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: [email protected] [mailto:[email protected]] On Behalf Of Dan Plesse
Sent: Tuesday, October 18, 2005 11:26 AM
To: [email protected]
Subject: [flexcoders] ComboBoxCellRenderer question

 

I want to change the data in the cell’s comboBox to other database
datatypes. 

So I tried this

var dp = new mx.central.data.DataProviderClass();
    dp.addItem({dataType:"tinyInt", dataType:"Double"});
    ComboBoxCellRenderer.setDataProvider(dp);

Error message:
There is no method with the name 'setDataProvider'

And this

var dp = new mx.central.data.DataProviderClass();
         dp.addItem({dataType:"tinyInt", dataType:"Double"});
         ComboBoxCellRenderer.dataProvider = dp;

No error

And This:

var dp = new mx.central.data.DataProviderClass();
         dp.addItem({dataType:"tinyInt", dataType:"Double"});
         ComboBoxCellRenderer.dataProvider.setDataProvider(dp);

No error:

Also where do I get the this control?
import com.iterationtwo.cairngorm.control.*;












--
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