gridjs icon indicating copy to clipboard operation
gridjs copied to clipboard

Pagination selector

Open andresfdel17 opened this issue 5 years ago • 7 comments

Hello, i need a pagination record selector please. i work with a lot of records and i want than my clients can choose te rows: Like this

pagination = {
      enabled: true,
      limit:[10,25,50,100],
      resetPageonUpdate: false
    };

or this

pagination = {
      enabled: true,
      limit:() => {
//here goes function to call a selector value
},
      resetPageonUpdate: false
    };

andresfdel17 avatar Nov 10 '20 14:11 andresfdel17

Good suggestion @andresfdel17. The current page size is static https://gridjs.io/docs/config/pagination. I can work on adding that feature.

afshinm avatar Dec 02 '20 21:12 afshinm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 31 '21 23:01 stale[bot]

It'd be also great if that setting was able to be exposed close to the search input :)

pcambra avatar Apr 20 '21 12:04 pcambra

Need this!

r14n avatar Jan 26 '23 19:01 r14n

Just fyi, you can do this:

const grid = new Grid({
	// ...
}).render(wrapper);

const limitRecords = document.querySelector("#limit-records");
limitRecords?.addEventListener('change', () => {
	grid?.updateConfig({
		pagination: {
    		limit: parseInt(limitRecords.value)
		}
	}).forceRender();
});

It's a bit hacky, but better than nothing.

xHeaven avatar Feb 09 '23 02:02 xHeaven

Really need this

aswzen avatar Sep 17 '23 05:09 aswzen

const limitRecords = document.querySelector("#limit-records");
limitRecords?.addEventListener('change', () => {
	grid?.updateConfig({
		pagination: {
    		limit: parseInt(limitRecords.value)
		}
	}).forceRender();
});

This didn't work for me (gave duplicate pagination plugin error), but this did:

		grid.config.pagination.limit = e.target.value;
		grid.forceRender();

monkekode avatar Nov 24 '23 09:11 monkekode