Announcement

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

    Issue with user's preference saving with saveViewState and fields with dataPath

    Hello!

    We have a grid created with fields using dataPath :

    Code:
     this.titleField = new ListGridField("title", "title");
    this.titleField.setDataPath("serie/title");
      this.definitionField = new ListGridField("definition", "definition");
    this.definitionField.setDataPath("definition/displayedValue");
    When save the user's preferences using setViewState() => The saved values used for sorting fields are not prefixed with "serie." or "definition." and this causes an error when reloading the user's preferences at the next diplsay. Is there an option on setViewState() or something else to do to deal with data paths?

    #2
    The viewState intentionally encodes just the field name, not the dataPath. So long as the same field names are present in the grid where the viewState is applied, this works. Changing the fields but using the same dataPaths would not be expected to work.

    Just a general note: the dataPath feature is intended to help certain legacy architectures, such as systems that work in terms of exchanging large messages with several different entity types in one message, and are incapable of providing separate access to each entity type. Don't use dataPath if this is not your situation.

    Comment

    Working...
    X