New configuration values for limiting CRUD results, choosing number of results and default pagelenght #939
Closed
mariovillani
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
Hey @mariovillani Yes, you can globally set the config here
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@karandatwani92 Correct file is I've changed it to:
to fit my needs. As i've said, there is no server-side check made. I may alter the HTML of the select and choose -1 to show all results. A server side check must be done. @pxpm can you check too? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Showing all the results in CRUD controllers may be a slow operation (client-side, due to the rendering of datatables and server-side for the query itself).
Actually, it is possible to set the default number of rows:
$this->crud->setDefaultPageLength(10); // number of rows shown in table view by default (client-side)
$this->crud->setPageLengthMenu([100, 200, 300]); // values to put in the number of results selector (client-side)
Then, it is requested to use limit to prevent querying for too much data server side:
$this->crud->limit(50); //limit number of results (server-side)
Those instructions need to be added in each CRUD controller. I think would be better to add some global configuration vars for CRUD package, setting:
for ALL crud entities.
Beta Was this translation helpful? Give feedback.
All reactions