Skip to main content
gabrielem0001
September 22, 2023
Solved

Progressive index in read only grid

  • September 22, 2023
  • 4 replies
  • 0 views

Hi,

I have a read only grid with recordType as data source. The total records are N, more than 5000. I have the need to show a column in the grid with a progressive index, from 1 to N.

Is there a way to achieve this using the recordType and without loosing some functionalities like user filters, excel export, etc.?

Thanks!

Best answer by peter.lewis

Ooooh this is a fun question! I think your best bet here is to use the information in fv!currentPage, since that has the start index and identifiers of the current page. Here's an example column for how I was able to get it to work:

a!gridColumn(
  label: "Index",
  value: fv!currentPage.startIndex - 1 + wherecontains(fv!identifier, tointeger(fv!currentPage.identifiers))
)

4 replies

peter.lewis
Employee
September 22, 2023

Ooooh this is a fun question! I think your best bet here is to use the information in fv!currentPage, since that has the start index and identifiers of the current page. Here's an example column for how I was able to get it to work:

a!gridColumn(
  label: "Index",
  value: fv!currentPage.startIndex - 1 + wherecontains(fv!identifier, tointeger(fv!currentPage.identifiers))
)

gabrielem0001
September 22, 2023

It works! Thank you Peter!

..I add a question: is it possible to export the grid including this new "virtual" column to Excel or at this point do I necessarily have to move on to creating a view?