I want to display index as number in increasing order.
Do you mean the internal index id? Maybe try using this PR as ref: https://github.com/yajra/laravel-datatables/pull/597
return $this->datatables
->collection($this->query())
->addIndexColumn()
->make(true);
I was indeed looking for addIndexColumn
Thank you for the quick reply,
@yajra At the JS side how we should add the new index column ?
@mansouralex by default, the data key used is DT_Row_Index:
{data: 'DT_Row_Index', orderable: false, searchable: false}
@yajra sir how can i order the indexcolumn to descending order, (3,2,1)
Thanks
I have still this error:
DataTables warning: table id=daily_schedule - Requested unknown parameter 'DT_Row_Index' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
@yajra
@javidjan sorry for the inconvenience. DT_Row_Index was renamed to DT_RowIndex.
See https://github.com/yajra/laravel-datatables/pull/1882 for ref.
Most helpful comment
@mansouralex by default, the data key used is
DT_Row_Index: