Skip to content

InvalidSearchColumn error when using column defined as data: null #399

Open
@diesl

Description

@diesl

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions