-
Notifications
You must be signed in to change notification settings - Fork 46
Description
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 BY columnNameSpecial
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:
'columns' => [
[
'data' => 'columnNameSpecial',
'title' => 'Name',
'render' => new JsExpression('function render(data, type, row, meta ){
return row.columnNameSpecial;
}'),
],
....
having in the model for example:
function getColumnNameSpecial() {
return $this->name . " " . $this->lastname;
}
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 ? ;-)