PDA

View Full Version : AdvancedDataGrid: more than one render provider?


fu-meng
09-09-2009, 11:49 PM
Hi,

If I have an AdvancedDataGrid, can I use more than one render provider?

For example, my first group will have a render provider that displays a row of
charts with a row of dropdown menus underneath.

My second group will have a render provider that displays two rows of charts.

Can I do that?

Thanks for any helpful tips...

Peter Cowling
09-10-2009, 11:17 PM
Technically, yes. Performance wise...

fu-meng
09-11-2009, 01:45 AM
Haha...thanks for the honest answer. I'm already experiencing some difficulties with another AdvancedDataGrid I have in my app. Nothing major, but I'm noticing slight lag time.

Anyway, I was thinking that I could I have one itemRenderer that could display both sets of components depending upon some variable. But which variable? How can an itemRenderer know whether to display one component versus another?

Peter Cowling
09-11-2009, 09:26 AM
The starting point would be to override set data. At that point you can use some variable in your data to determine what to do next.

fu-meng
09-14-2009, 12:11 AM
Thanks Peter, it worked like a charm (but you're right about the performance). Just in case it helps someone else, here's what I did:

- like Peter said, override set data
- use conditional to determine data type, i.e. data is instance of DTO or VO or whatever you use.
- then laid out based on conditional.