How show a static number of rows using Ag datagrid

Viewed 60

I'm new on reactjs, and I want to create a table to show some data. In the project I'm working, we are using Ag-Grid datagrid.

I already have created it with basic usage, but my question is:

Supose I have 100 rows as enter, how I can display in datagrid just the 10 firsts?

I stil wanna load all data (for filtering, sort, etc), just don't wanna show all by default.

I'm looking at documentation and do some search, but don't find the proper way to do it.

Edit: I already see the pagination options (the default solution provided by documentation), but in my case, at least for now I don't want pagination. Just wanna render the X first rows (the extra will be ommited in table, but have to be loaded in UI, if not, I could use autoHeight).

Thanks in advance.

2 Answers

I'm assuming you are using the Client Side Row Model and not loading data from a Server. In which case, the easiest way to achieve this would be to show the 10 rows, and add more rows (depending on when you want to load them) via Transaction Updates, please see the documentation on this here

Related