开发者

Custom Combo box itemrenderer in Flex Datagrid

开发者 https://www.devze.com 2023-01-22 05:39 出处:网络
A combo box as an item renderer for a data cell in a Flex Datagrid has been demostrated at various blogs. What if that combo box has to have an external dataprovider that has to be set at the time of

A combo box as an item renderer for a data cell in a Flex Datagrid has been demostrated at various blogs. What if that combo box has to have an external dataprovider that has to be set at the time of converting the renderer class to a ClassFactory.

Can this be done? Or is there a work开发者_如何转开发around?

Thanks in advance.


What if that combo box has to have an external dataprovider that has to be set at the time of converting the renderer class to a ClassFactory.

I don't think you meant to say what you said. But, at runtime, a renderer class is never converted into a ClassFactory. The renderer properties, such as itemRenderer or itemEditor are always factories. Now, the Flex compiler does some magic so that you specify the class name in MXML, it turns it into a ClassFactory. This happens at compile time.

I believe you mean that you want to set the dataProvider on the instance of the ComboBox as they are created by the ClassFactory. Is that correct? If so, you can extend the ClassFactory to do so.

You could also extend the ComboBox to be "dataProvider" aware. One approach is to build the remote service call to retrieve data directly into your extended ComboBox. Another might be to hard coded the dataProvider, Yet another might be to access some other application specific component for the data. One such example is using the Cairngorm ModelLocator.

Does that help?

0

精彩评论

暂无评论...
验证码 换一张
取 消