cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strato DataTable.Pagination is there a way to change the values available in the drop down for "row per page"

scott-smith
Participant

I would like the row per page values to be different than what is there by default [10, 20, 30, 40 ,50].  Is there a way to change this?

3 REPLIES 3

imsingh
Dynatrace Advisor
Dynatrace Advisor

Hi there

 

Yes, you can change the page size to any value you want. In the following example, I changed the default size to 7:

    <DataTable columns={columns} data={data}>
      <DataTable.Pagination defaultPageSize={7} />
    </DataTable>

 

Thanks

Thank you.  Is there also a way to change the list of page sizes that can be selected in the drop down list displayed.

Hi @scott-smith ,

The defaultPageSize also influences the page size dropdown list ("x rows per page"). The specified value will be displayed as the smallest page size value. Furthermore, up to 4 more options will be available in the UI. The default options are 10, 20, 30, 40, and 50. If you specify a defaultPageSize of 7 , the options will automatically be 7, 14, 21, 28, and 35.

Could you let me know if this meets what you're trying to achieve?

Featured Posts