Announcement

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

    12.0p Does a feature similar to ListGrid.setEditorCustomizer() for the normal display of ListGrid (not edit)

    Hi Isomorphic,

    does a feature similar to ListGrid.setEditorCustomizer() for the normal display of ListGrid (not edit) exist?
    Imagine a table that stores the wanted default value for a column if a new row of some object is created:
    objectname column defaultvalue
    person language_id 1
    person country_id 2
    person name <null>
    If I new person is created I use this data serverside to prefill the named DB fields with these IDs.
    Now if I edit these, I can use a SelectItem with Datasource "language" for "language_id" and another SelectItem with Datasource "country" for "country_id" via setEditorCustomizer() and in edit mode I see the language/country name instead of ID. This is working fine.

    In the ListGrid display, I do see IDs, though (as expected).
    Is there a way to customize ListGridField.setOptionDataSource() on a per-row basis like I can customize editors? Either in ListGrid or ListGridField.

    In a sample, I'd like for example to resolve here the Silder Editor-row value to a "employee"-DataSource lookup.

    Thank you & Best regards
    Blama

    #2
    It seems like you're hoping that the ListGrid will maintain separate caches from separate DataSources and perform lookups of IDs against those caches based on some API where you'd tell it which DataSource applies to the row?

    No, there is no such feature. But you can simply use a CellFormatter and do such lookups against multiple caches yourself.

    Comment


      #3
      Hi Isomorphic,

      thanks for the fast answer. I already assumed so, as I did not find any API for this.
      I also thought about CellFormatter. Should this really work as well with an Async lookup? Or do you mean that I cache the data in advance?

      Best regards
      Blama

      Comment


        #4
        Cell formatter is a synchronous API, so yes, you would either need to fetch the data beforehand, or fetch it asynchronously and have the CellFormatter return a placeholder value until the data arrives.

        Comment

        Working...
        X