Skip to content
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

Column of type select_multiple doesn't work with AjaxTables #120

Closed
alexgmin opened this issue Sep 20, 2016 · 3 comments
Closed

Column of type select_multiple doesn't work with AjaxTables #120

alexgmin opened this issue Sep 20, 2016 · 3 comments
Assignees
Labels

Comments

@alexgmin
Copy link

On the demo, I'm trying to create this column on articles

[
   // n-n relationship (with pivot table)
   'label' => "Tags", // Table column heading
   'type' => "select_multiple",
   'name' => 'tags', // the method that defines the relationship in your Model
   'entity' => 'tags', // the method that defines the relationship in your Model
   'attribute' => "name", // foreign key attribute that is shown to user
   'model' => "Backpack\NewsCRUD\app\Models\Tag", // foreign key model
]

works well on a normal table, but, when you enable ajaxTable it doesn't work.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tags' in 'field list' (SQL: select `date` as `date`, `status` as `status`, `title` as `title`, `featured` as `featured`, `category_id` as `category_id`, `tags` as `tags`, `id` as `id` from `articles` order by `date` asc limit 25 offset 0)
@tabacitu
Copy link
Member

Hi @alexgmin ,

Thank you for the bug, I can confirm that n-n relationship columns don't seem to work on the AjaxDataTable. I'll look for a solution and get back to you.

Cheers!

@OwenMelbz
Copy link
Contributor

@tabacitu I've had a dig around, and it seems the issue is occurring because the columns passed to the DataTable are not columns, so it breaks.

I've added a potential fix to prevent this - however the filter can be adjusted if there is a better way to find out if its a relational column

#139

@tabacitu
Copy link
Member

Hi @alexgmin ,

You can use "select_multiple" columns with Ajax Datatables. A composer update should fix it for you.

Cheers!

This was referenced Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants