Laravel-datatables: sorting doesn't work with DT_RowIndex , it searches for a column named DT_RowIndex when sorting button is pressed.

Created on 9 Apr 2019  路  1Comment  路  Source: yajra/laravel-datatables

Screenshot 2019-04-09 at 6 36 39 PM

Sorting of the column with DT_RowIndex values. screenshot of error is attached.

columns: [
              { data: 'id', name: 'id'},
              { data: 'DT_RowIndex', name: 'DT_RowIndex', "orderable":true, "ordeing":true, "searchable":true, "className" : "my_class"},
             {
                        "className":'details-control',
                        "orderable":false,
                        "ordeing":false,
                        "searchable":false,
                        "data":null,
                        "defaultContent":''
                    },

System details

  • PHP Version 7.2
  • Laravel Version 5.7
question

Most helpful comment

DT_RowIndex is a computed column, thus searching and sorting are expected not to work when using it. Unless the value was fetched from the database too.

>All comments

DT_RowIndex is a computed column, thus searching and sorting are expected not to work when using it. Unless the value was fetched from the database too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hohuuhau picture hohuuhau  路  3Comments

Mopster picture Mopster  路  3Comments

ahmadbadpey picture ahmadbadpey  路  3Comments

hari-web picture hari-web  路  3Comments

SGarridoDev picture SGarridoDev  路  3Comments