View Full Version : [2.0 M2] GridView/TreeView adds "gxt-id" and "gxt-widgetlist" to model items

Curt Arnold
22 May 2009, 12:14 PM
GridView starting in M2 now expects to be able to get and set "gxt-widgetlist" on items in the backing store. TreeGrid and TreePanel do the same with "gxt-id". Previously all view related properties were inserted into the model with property names starting with "_".

The addition of new GXT property insertions that do not fit the previous naming convention can cause applications that provide their own implementations of Model or ModelData to misbehave. In my case, it caused class cast exceptions on the return value. Other custom implementations of Model might result in "gxt-widgetlist" being attempted to be added to a database or some other backing store.

It is undesirable to mix view-specific data with the model, I'd expect that the approach would cause undesirable interactions if the same Model were participating in multiple grids. Ideally, you would either wrap the ModelData in a view specific object or otherwise associate the view specific data with the model data via a map.

However, if it must remain, then GXT added properties should consistently use the previous "_" naming convention.