CRUD: Order by not working with enableDetailsRow
When i put
$this->crud->enableDetailsRow();
in my controller the order by (click on the columns titles) on the list is not working anymore.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (12 by maintainers)
Commits related to this issue
- Update to attempt to test bug for 618. https://github.com/Laravel-Backpack/CRUD/issues/618 Enabled ajaxTables and details row. — committed to lloy0076/backpack-test by lloy0076 7 years ago
@MarcosBL thanks for reopening it earlier!
Confirmed here (3.2.10), Datatables is ordering the wrong column due to a off by one bug when enableDetailsRow is On: if you click on the 2º column, it will order by the 3º
For example, a click on “Hecha” sorts by “Comercial”
Maybe fixed in https://github.com/Laravel-Backpack/CRUD/pull/619 if you want to give it a try, as it defines the column with the “+” sign as non sortable, and the problem seems to be Datatables ordering the wrong column due to a off by one error
@MarcosBL , I was thinking of a similar solution
$this->crud->searchColumns, but it might not be needed with the new search feature in https://github.com/Laravel-Backpack/CRUD/pull/445. Let’s talk about that there and keep this issue for enableDetailsRow.@adbmdp - I can’t seem to be able to replicate your issue. When ajaxDataTables is off, my column reordering works with and without enableDetailsRow… Try a
composer updatemaybe?