Answered: How to use ModelData with GXT3
I dont want to use AutoBean with Grids. I want to JSON and ModelData as GXT 2.5. but i dont want migration mode.
How do make a solutions?
Posted by Colin Alworth
Take a look at the blog post from back in July on presenting data: http://www.sencha.com/blog/building-gxt-charts/ . Much of it about charts, but under the heading ValueProvider there is a discussion on how model objects can be built that don't follow the standard 'beak-like' format, and how ValueProvider can allow you to refer to the data within those objects.
The data model discussed there is essentially a Map<String, Double>, and values can be read and written by the Grid (in the article Brendan uses Chart, but it is the same idea, the same interface is used throughout) using the specialized ValueProviders.
If your model might support String -> Double/Integer/String/Enum, you could build several ValueProviders that describe how to read and write all the possible values. This is what is done in the gxt-legacy.jar in the BaseModelData and ModelDataValueProvider classes.