Closed raflyasyahdani11 closed 5 months ago
I suspect this is due to ordering on the relation. Try removing $data->orderBy('paid.tanggal');
I suspect this is due to ordering on the relation. Try removing
$data->orderBy('paid.tanggal');
its working fine, but how to order it by the relation, any suggest?
It depends on the relation, some may not work as expected. The package will try to join the related table. For a more stable solution, you can use SQL joins.
To sort by relation, you can declare it in the js column:
columns: [
{data: 'paid.tanggal', name: 'paid.tanggal'}
]
It depends on the relation, some may not work as expected. The package will try to join the related table. For a more stable solution, you can use SQL joins.
To sort by relation, you can declare it in the js column:
columns: [ {data: 'paid.tanggal', name: 'paid.tanggal'} ]
How can I set the default sorting order when the page first loads?
order: [
[1, 'asc']
]
Just change the index as needed.
thanks!! it works as expected
Summary of problem or feature request
Hello hope you in a great condition, i have a problem sorting on my model because of auto total record query. I have already try to use
skipTotalRecords
but its still generating the count query. The error description that i get from laravel is :Column not found: 1054 in order clause
. And the weird thing is when i try sort directly from datatable html table i just working fine.Code snippet of problem
System details