Announcement

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

    How to control order of ListGrid fields when using setUseAllDataSourceFields(true)

    I have a ListGrid where I want all data source fields to appear first, then followed by a set of fields that are not in the datasource. I'm calling setUseAllDataSourceFields(true) then calling setFields() to add the extra fields.

    The problem is that the extra fields appear as the first columns. I should mention that the extra fields are grouped with HeaderSpans. How do I get those fields to appear as the rightmost columns?

    The doc for setUseAllDataSourceFields(true) says this, which I don't quite follow.
    If component.fields contains fields that are not found in the DataSource, they will be shown after the most recently referred to DataSource field. If the new fields appear first, they will be shown first.
    Can you explain what is meant by that last sentence?

    #2
    It's an accurate but very pithy sentence :) Take a look at this sample - note how the code specifies an item for the "password" field with providing any settings on that item. The purpose of doing this is so that subsequently added FormItems appear after the password field.

    Comment

    Working...
    X