Hi,
We are setting properties of ListGrid fields in 2 places:
1. Define number of field properties in DS
2. Add/override more runtime based on a context while building the grid.
In SmartGWT 3.1 we did:
1. If grid layout is not modified and saved by a user - read the datasource fields and set them on the grid via setFields
2. If layout exists - use grid.setViewState to set saved layout
3. In both cases get fields using grid.getFields and then iterate over them and set runtime settings.
As we're evaluating 6.1 for an upgrade, one of the changes from 3.1 we found is grid.getFields (and grid.getAllFields) is null after setViewState is called.
I am planning to change our approach and always first set fields from datasource, then call setViewState(if necessary) and then modify fields from getFields()
However, I am not sure this is the best way to go about it - seems redundant.
I am assuming this is a fairly typical problem people face - is there a best practices approach?
Thanks!
We are setting properties of ListGrid fields in 2 places:
1. Define number of field properties in DS
2. Add/override more runtime based on a context while building the grid.
In SmartGWT 3.1 we did:
1. If grid layout is not modified and saved by a user - read the datasource fields and set them on the grid via setFields
2. If layout exists - use grid.setViewState to set saved layout
3. In both cases get fields using grid.getFields and then iterate over them and set runtime settings.
As we're evaluating 6.1 for an upgrade, one of the changes from 3.1 we found is grid.getFields (and grid.getAllFields) is null after setViewState is called.
I am planning to change our approach and always first set fields from datasource, then call setViewState(if necessary) and then modify fields from getFields()
However, I am not sure this is the best way to go about it - seems redundant.
I am assuming this is a fairly typical problem people face - is there a best practices approach?
Thanks!
Comment