Change Active Work grid items/page
How we can change the default # of items displayed per page in the grid? Default is set to 20, I always change to 100 but I would like to hardcoded by default to 200 at least. I also would like to see the page crumbs menu on top, to scrool down to the bottom is not very time efficient.
Thank You
Comments
This would look like this:
insertBefore() is being used now (line 8) which moves the pagination element. You would need to find a different method which copies/clones the element instead of moving it.
Good solution @Nicholas_Velich but two relatively minor issues that you may want to be aware of:
Instead of the setTimeout, is there a way to trigger off when the grid is added to the page ?
I'll let you know if I find solution to these.
Thanks for the feedback! This is more of a proof of concept rather than a polished solution, so it can definitely be improved further.
For (1), you could potentially do something similar to what @joivan_hedrick did here.
For (2), I don't know that there is a "is default still set" we can look to for the pagination, but you could potentially look to see if the user had any existing filters, groupings, sorting, etc, and only apply the 200 per page setting if all those other defaults were still selected (that would get you closer anyway). For example, looking to see if the user has made a custom filter would be done like this:
if($(this).data('kendoGrid').dataSource._filter == null){
// If we are in here, that means the user never applied any kendo filtering elements. The code to change the pagination would then go here.
}
Thanks,
Nick
Hi,
I changed a little bit in the code so it counts for all views. But now, if a user changed the default, every time after reloading the page it is set back to 50. Is there a way to solve this?
My changed piece of code:
if(url.indexOf("/View/") > -1){ // Verify we are on ta View page