How do I default a dropdown field in a editable grid (SAIL)

I have an editable grid in SAIL (v16.2).  One of the columns has a dropdown field.  I need to setup a default "East US" in the dropdown field in the grid.  When the 'Add Items' is clicked the column with the dropdown need to default with "East US" for each row.  See the attached image.  Each row should look like what is displayed in the image when each row is added.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer
    When you add new items, you should be calling a expression to create a new item (CDT, for example) and appending to list which is 1:1 with your rows.

    Then, when you create that new row item, you would need to set the dropdown value to whatever value you need. So, when the grid renders all available rows, the a!dropdownField value attribute per row will already be prepopulated.

    Using CDTs as an example, if my addRowLink is defined to append a new CDT to a CDT array representing my rows as something like:

    a!dynamicLink(saveInto:a!save(myRowCDT,append(myRowCDT, newRowItem))

    Then newRowItem would be defined with a type constructor as something like type!yourRowCDT(dropdownValue:"East US"...).
Reply
  • +1
    Certified Lead Developer
    When you add new items, you should be calling a expression to create a new item (CDT, for example) and appending to list which is 1:1 with your rows.

    Then, when you create that new row item, you would need to set the dropdown value to whatever value you need. So, when the grid renders all available rows, the a!dropdownField value attribute per row will already be prepopulated.

    Using CDTs as an example, if my addRowLink is defined to append a new CDT to a CDT array representing my rows as something like:

    a!dynamicLink(saveInto:a!save(myRowCDT,append(myRowCDT, newRowItem))

    Then newRowItem would be defined with a type constructor as something like type!yourRowCDT(dropdownValue:"East US"...).
Children
No Data