Paging info and record data type as data in a gridfield

Certified Senior Developer

Hi,

my client wants the search box and the filter style of a common Record Type. We implemented a gridfield with a!recordData as "data", but with time, it became very slow.

I would like to implement the pagination, but with the a!recordData is not possible. Even, I tried to use the a!queryRecordType() and it works fine (it's very fast!)

but in this way, we lose the possibility of having the checkbox and the user filters and the Excel export button, and so on...

Does anyone know how to help me? I already tried to maximize the performance of the record type with default filters, but I don't know how to face this issue.

Thank you to whom will help me!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Why is pagination not possible with recordData?

  • Agreed, this should be possible using the default behavior of a record type as the source. Can you post some sample code snippets so we can understand what you did and what you're trying to do?

  • 0
    Certified Senior Developer
    in reply to Peter Lewis

    a!gridField(
      labelPosition: "ABOVE",
      data: a!recordData(
        recordType: 'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync',
        filters: a!queryLogicalExpression(
          operator: "AND",
          filters: {
            a!queryFilter(
              field: 'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.fields.{COD_PRESTAZIONE}COD_PRESTAZIONE',
              operator: "=",
              value: ri!cdPrestazione
            )
          },
          ignoreFiltersWithEmptyValues: true
        ),
      ),
      columns: {
        a!gridColumn(
          label: "N. Cartella",
          sortField: 'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.fields.{batch_number}batch_number',
          value: fv!row['recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.fields.{batch_number}batch_number'],
          width: "NARROW"
        ),
      },
      initialSorts: {
        a!sortInfo(
          field: 'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.fields.{batch_number}batch_number'
        )
      },
      refreshAfter: "RECORD_ACTION",
      userFilters: {
        'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.filters.{60b84149-ff44-44b1-bb87-c38221a4f95a}By Batch Number',
        'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.filters.{93f5c280-f556-4865-a236-dce6cd1499b4}By load user',
        'recordType!{993de3c1-0b0e-4cd9-ac5f-069e4d6920b5}RGF Files Loaded Not Sync.filters.{bae464b4-c7da-4b1b-86a7-fcea8dfc13eb}By File Name'
      },
      showSearchBox: true,
      showRefreshButton: true,
      showExportButton: true,
    )

    I don't know if I'm wrong, but using the a!queryRecordType() as data with my own pagingInfo increments a lot the performance, while using the a!recordData I got this bad performance. I need record data because we need to use the showExportButton, the showSearchBox, and the userFilters. As I said, I tried to improve the performance of the record type as well, but this is the best I achieved.

  • 0
    Certified Lead Developer
    in reply to pierpaolo.longobardi

    I think we need more details about the data source. Is that a view? How many rows do you display in that grid? Why do these user filters take almost a second to evaluate?

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Hi Stefan, 

    thank you for your answer.

    The record type is based on a db table. It retrieves about 400 rows (with the filter in the a!recordType, otherwise it would be about 6000). We have 3 user filters. In each one, we inserted a series of recordFilterListOption based on the aggregation of the fields in the record type, queried with queryRecordType.

    I hope I was clear.

    Thank you for your time!

Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Hi Stefan, 

    thank you for your answer.

    The record type is based on a db table. It retrieves about 400 rows (with the filter in the a!recordType, otherwise it would be about 6000). We have 3 user filters. In each one, we inserted a series of recordFilterListOption based on the aggregation of the fields in the record type, queried with queryRecordType.

    I hope I was clear.

    Thank you for your time!

Children
No Data