change the row count in MDBDataTable


Topic: change the row count in MDBDataTable

Rabie.jabasini pro premium asked a year ago

Expected behavior I need to change the default amount of row that appear when my table load

Actual behavior I'm using the following code but i did knew how to edit the default row number

Resources (screenshots, code snippets etc.)


Piotr Glejzer staff answered a year ago

Hi,

may you try to add prop entriesOptions to like this?

 <MDBDataTable entriesOptions={[20, 30, 40, 60]} striped bordered hover data={data} />

it will be load array to select and show 20 first rows on load. You can customize it how you want.

Best, Piotr


Prem Sai commented 11 months ago

It is Still loading 10 items on first/initial load, but its working fine after you change dropdown, but on initial screen dropdown number is pointing to 50 but showing first 10 items


Prem Sai commented 11 months ago

Thanks team i found solution if i add this prop entries={50} it is loading properly


Status

Closed

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: React
  • MDB Version: 4.21.0
  • Device: laptop
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No