Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to manipulate all ListGridField definitions

    I have a sublcass of ListGrid where I have override the setFields(ListGridField...) method to implement some overrides to the field attributes based on meta-data in the ds.xml definition. It works fine, but only when setFields() is called of course. When setFields() is not called, or when setFields is called but setUseAllDataSourceFields is set to true, I don't have an opportunity to override the other datasource fields.

    Is there a point at which I can access and change *all* of the fields that will be part of the ListGrid and apply my customizations to them?

    #2
    SmartGWT doesn't have a notification thats explicitly called as a result of the fields changing due to databinding, but you could probably handle this reasonably cleanly by
    - overriding setDataSource() to always call setFields() [with empty params, perhaps]
    - overriding setFields() to explicitly check for whether useAllDataSourceFields is true or the case where it was called directly from setDataSource(), and build an explicit array of trivial ListGridFields to represent the DS fields that weren't explicitly passed in, ultimately calling "super" with the combined set of fields.

    Let us know if that won't work for some reason.

    Comment

    Working...
    X