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

Unknown column 'DT_Row_Index' in 'order clause' #1846

Closed
rebornishard opened this issue Sep 20, 2018 · 7 comments
Closed

Unknown column 'DT_Row_Index' in 'order clause' #1846

rebornishard opened this issue Sep 20, 2018 · 7 comments
Labels

Comments

@rebornishard
Copy link

Summary of problem or feature request

i add
->addIndexColumn()

in Controller,

in view I add

{ data: 'DT_Row_Index', name: 'DT_Row_Index' }

This error always appear :
Unknown column 'DT_Row_Index' in 'order clause'

@yajra
Copy link
Owner

yajra commented Sep 20, 2018

It's added column and not part of the DB that's why it's not sortable. To fix, do:

{ data: 'DT_Row_Index', name: 'DT_Row_Index' , orderable: false, searchable: false}

@yajra yajra added the question label Sep 20, 2018
@rebornishard
Copy link
Author

@yajra Thanks a lot yajra, is that impossible to sort that coloumn ?

@yajra
Copy link
Owner

yajra commented Sep 20, 2018

Yes, I think it's impossible because index column is not part of the database / query. My usual guide is if it's doable on SQL level, the package should be able to handle it. Otherwise, it's not possible.

@rebornishard
Copy link
Author

@yajra : ok I get it, btw thanks again for this great package,

how about adding notes for this one :
{ data: 'DT_Row_Index', name: 'DT_Row_Index' , orderable: false, searchable: false}

in : https://yajrabox.com/docs/laravel-datatables/master/index-column

@yajra
Copy link
Owner

yajra commented Sep 20, 2018

Oh thanks, will add that when I got the chance. You can also PR if you can at https://github.com/yajra/laravel-datatables-docs/blob/master/index-column.md. Thanks!

@yajra yajra closed this as completed Sep 20, 2018
@MubinSayed
Copy link

MubinSayed commented Aug 7, 2021

name: 'DT_Row_Index' , orderable: false, searchable: fals

DT_RowIndex

{ data: 'DT_RowIndex', name: 'DT_RowIndex' , orderable: false, searchable: false}

@riansefriadi
Copy link

It's added column and not part of the DB that's why it's not sortable. To fix, do:

{ data: 'DT_Row_Index', name: 'DT_Row_Index' , orderable: false, searchable: false}

it's work for me thanks

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants