Replies: 1 comment 2 replies
-
Whenever the column name is different from the one in the database, remember to reference it in dataField in the Column::field() method otherwise sortable will not work. This isn't much help because I'm a ape not a developer, but it uses DB to sort, so you might need to make database field name 'first_name' |
Beta Was this translation helpful? Give feedback.
2 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.
-
I am using the latest version of this package and using the Bootstrap theme.
In the database, I have first_name and last_name columns. So I added the following code in the
addColumns()
Methodin the
columns()
method, I added followingColumn::make('Name', 'full_name' )->sortable()->searchable()
in the
filters()
method, I added followingvalue displaying is ok, search filter is ok. but when trying to sort it is not working. I am getting the following SQL error.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'full_name' in 'order clause'
I am not sure how to do it. any suggestion is welcome.
Beta Was this translation helpful? Give feedback.
All reactions