Sorting a Grid #220
Replies: 4 comments 5 replies
-
$sort = Sort::only([
'status_id',
'phone_id',
'sales_manager_id',
'creation_date',
'modified_date',
])->withOrder(['creation_date' => 'desc']);
$dataReader = $dataReader->withSort($sort); |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Currently, header format is If avaliable sort by column, then To generate URL grid view use url creator that you can set via method Also you can set options:
|
Beta Was this translation helpful? Give feedback.
-
Ok thanks Vjik. I have moved the Additional code: InvController.php
Additional code: inv/index
Full code: |
Beta Was this translation helpful? Give feedback.
-
Code:
How can the above code be improved?


Weakness: It only allows for one sorting column namely the 'id'. I want to move the
buttons into their own header and ideally there should be some configuration file/array that I can adjust.
Beta Was this translation helpful? Give feedback.
All reactions