Answered: Dynamic Grid
how can I create and popolate a Grid with a dynamic bean?
This dynamic bean has an indeterminate number of fields, so the number of columns of the Grid is also undetermined ( but determined only at runtime).
In addition, I have a list with the names of the columns corresponding to the dynamic bean's fields.
Thanks and regards,
Posted by Colin Alworth
In short, yes it is possible - simply build a ValueProvider that can read from your generic object. If you actually have a class that changes from day to day, make the process that updates it also update the PropertyAccess, and add any additional wiring to build the grid - GXT can't magically add new code based on other changing code, as GWT compiled code cannot do reflection/introspection.
If your model is backed by a Map of some kind, it should be possible to build a ValueProvider that reads into that map and gets whatever key you are supporting. Check out a new example in the nightly build that shows how this can be achieved, specifically the MapValueProvider class http://staging.sencha.com:8080/examp...namiclinechart
The tail end of today's forum post is especially relevant to this topic: http://www.sencha.com/blog/building-gxt-charts/
Tags for this Thread