Paging an editable grid, and persisting the data across pages in the UI

I am looking for a way to page an array of CDTs in an editable grid.  The caveat is that I need the data to persist across pages.  Has anyone done this before?  Some code examples would be great.

  Discussion posts and replies are publicly visible

Parents Reply
  • Then the aforementioned sample code with a small tweak will do the job. Try this with your custom pagination:

    a!localVariables(
      local!items: {
        {item: "Item 1", qty: 1},
        {item: "Item 2", qty: 2},
        {item: "Item 3", qty: 1},
        {item: "Item 4", qty: 3},
        {item: "Item 5", qty: 4}
      },
      a!gridLayout(
        label: "Products",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Item"),
          a!gridLayoutHeaderCell(label: "Qty")
        },
        rows: a!forEach(
          items: local!items,
          expression: a!gridRowLayout(
            contents: {
              a!textField(
                value: local!items[fv!index].item,
                saveInto: local!items[fv!index].item
              ),
              a!integerField(
                value: local!items[fv!index].qty,
                saveInto: local!items[fv!index].qty
              )
            }
          )
        )
      )
    )

    Change the details as per your requirement. Hope it helps.

Children
No Data