Announcement

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

    ListGridField fetchMissionValues

    SmartClient Version: v10.1p_2015-12-18/Pro Deployment (built 2015-12-18)

    I have a ListGridField with a optionDatasource.
    My problem is that this ListGridField sometimes have values that are not present in the picklist fetched from the optionDatasource.

    FetchMissingValues requests are only sent when I actually enter the editor for the field, and the values are not saved to the displayMap so when I exit the editor it goes back to showing the underlying value.

    I cant figure out how to distinguish between a fetch request for the displayMap and one for the picklist. It that even possible?

    I guess I want to somehow return all the display values in the initial fetch (from ListGrid.autoFetchDisplayMap) and only a subset of the values when fetching for the picklidt.

    I hope it makes sense, otherwise let me know and I will try to explain it better.
    Last edited by Niels_EMP; 2 Feb 2016, 05:30.

    #2
    Read the docs for listGridField.optionDataSource - the suggestion is to deliver the display values in the main set of Records loaded into the grid (those shown as rows), as a separate attribute.

    When saving, the record returned from the update or add operation should have an updated displayField value as well, thus updating the grid without the need for a separate cache.

    Comment


      #3
      Okay I see.

      So if I use this method I am not supposed to set an optionDatasource on the field. So do I just set the picklist data via a manual fetch to the "old" optionDatasource and setValueMap?

      Comment


        #4
        You should set optionDataSource via editorProperties or editorType as normal. Since listGridField.optionDataSource has not been set, this won't cause a full-DataSource fetch, and the editor will automatically pick up the current displayField value from the Record when editing starts.

        Comment

        Working...
        X