-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extraColumns and serverSide does not get along well #57
Comments
Ok, I found some things ... I have realized I have to add the extraColumns ALSO in the "datatables" action in the Controller. That's ok ... but I don't understand the example you put here: https://github.com/NullRefExcep/yii2-datatables#extra-columns
How is the model ? Does it have getCustomPrice() and getCustomField() methods ? |
Hey @adantart |
Hi!
Amazing package ;-)
I've tried to activate the serverSide but the datatables action ajax call gives me an error:
Unknown column 'columnNameSpecial' in 'order clause' The SQL being executed was: SELECT * FROM
client
ORDER BYcolumnNameSpecial
LIMIT 10"being "columnNameSpecial" one of the "extraColumns" I have declared in the widget.
When you use extraColumns to put enhanced information, you need to put the name of the model function in the "data" attribute of each column. I mean, for example:
having in the model for example:
But in the other hand, the applyOrder and applyFilter of 'datatables' array in actions() needs the $column["data"] to be a REAL attribute of the model, because it will construct with that name, the applyFilters and orderBy of the ActiveRecord. That's the reason I have the "sql error" of the beginning.
Any ideas ? ;-)
The text was updated successfully, but these errors were encountered: