Description
I have some table columns that are not linked to a database column. These columns are used for example to display an input field, some static text, etc. I use the null
type of columns.data
Example:
columnDefs: [
{
targets: 'css-class'
data: null
defaultContent: 'foobar'
searchable: false
orderable: false
},
...
]
This is working with ajax-datatables-rails 1.2.0, but with newer versions I get a validation error:
Unknown column. Check that
data
field is filled on JS side with the column name
I am not sure how to "fix" this error. Can you point me to the right direction to make it work again?
EDIT:
Not sure why, but somehow I missed the closed issues about this topic:
- AjaxDatatablesRails::Error::InvalidSearchColumn with 1.3.1 #386
- AjaxDatatablesRails::Error::InvalidSearchColumn (Check that column '12' exists in view_columns): #385
However, I do not think your proposed "fix" to map a virtual column to some existing model attribute is a solution. On the contrary, it feels like a workaround for an problem that was introduced without need.
Additionally I want to add that this is another breaking change (next to #383) that was introduced in a minor release. I propose to revert this change and release a new minor version 1.4.0.