Announcement

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

    Missing API: ListGridField.setSortField(String sortField)

    Hi Isomorphic,

    I think there might be use for the API ListGridField.setSortField(String sortField) in ListGridField (http://www.smartclient.com/smartgwte...GridField.html) in SmartGWT.
    See this use-case:
    • Editable (important) ListGrid
    • table task (id, name, priority_id)
    • table priority (id, name, position) with values
      • {34; Low; 1}
      • {3; Medium; 2}
      • {100; High; 3}
    • tasktable is shown in ListGrid, on click on the priority-columnheader it should be sorted by priority-position.

    So far I can't do this. In my task.ds.xml I'd have:
    Code:
    <field name="priority_id" displayField="priority_name" />
    <field name="priority_name" nativeName="name" tableName="priority" />
    
    ...
    [table-clause with join, or add includeFrom/foreignKey above]
    ...
    Now, with the already available API setSortByDisplayField(boolean) I can configure whether to sort by priority_id or priority_name. Sorting via priority_position or any other field is not possible.
    Using setSortNormalizer is no option in my opinion as it would lead to inconsistent behaviour with regards to SQL-paging.
    So I think a method setSortField(String sortField) might be very useful, as this would be used locally as well as with SQL-paging.

    What do you think? Am I missing something?

    Thanks,
    Blama
    Last edited by Blama; 29 Dec 2012, 02:22. Reason: typo

    #2
    Hi Isomorphic,

    I think it would be great if this (as well as the already available setSortByDisplayField(boolean)) could be defined in the ds.xml-field (http://www.smartclient.com/smartgwte...urceField.html) as well.

    Best regards,
    Blama
    Last edited by Blama; 29 Dec 2012, 02:34. Reason: typo

    Comment

    Working...
    X