You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've recently implemented filters on my CRUD controller, when I try to load the CRUD list view it slowly loads all the items and the pagination loads the items slowly too.
I searched for the problem and I found an issue about 'Slow perfomance in big tables', saying it could be fixed by implementing $this->crud->enableAjaxTable(); in my Entity Crud Controller. The problem is I already implemented that and it doesn't seem to help.
Ok, found a way to fix it, the problem was in the filter implementation code. I changed from return News_Posts::all()->pluck('country', 'country')->toArray(); to return News_Posts::pluck('country','country')->toArray();
Hello, I've recently implemented filters on my CRUD controller, when I try to load the CRUD list view it slowly loads all the items and the pagination loads the items slowly too.
I searched for the problem and I found an issue about 'Slow perfomance in big tables', saying it could be fixed by implementing
$this->crud->enableAjaxTable();
in my Entity Crud Controller. The problem is I already implemented that and it doesn't seem to help.Here's the filter implementation code:
$this->crud->addFilter([ 'name' => 'country', 'type' => 'select2', 'label' => 'Country' ], function() { return News_Posts::all()->pluck('country', 'country')->toArray(); } , function ($value) { $this->crud->addClause('where', 'country', $value); });
PS: I'm using Laravel version 5.3.30; Backpack-crud version 3.2.3
Any suggestions and tips is highly appreciated!
The text was updated successfully, but these errors were encountered: