How to use sorting on server side ?
How to use sorting on server side ?
reiki
Posts: 46Questions: 11Answers: 0
i got my server side to true, where do i setup the code to sort and order the column in laravel using yajrabox ? i have no idea cause the example in serverside
in this website not showing where do i put the serverside code to begin with , if its in the same route with the ajax ? if so is there any example of how to get the data and return it back to the datatables ? is it the same as initial table ?
This question has an accepted answers - jump to answer
Answers
Probably best to ask in the Yajra support channels. That isn't software produced or supported by us I'm afraid.
In this example it is in the PHP script
server_processing.php
. Laravel has a different way of routing from plain PHP files though, so I'm not sure that example will be all that useful to you.Allan
Okay thanks @allan , its hard cause the yajra doc has only little explanation
okay i found out how, for the people in the future who had same problem basically the datatables still goes to the AJAX url you provide and it give another payload which is
order[0][column]
andorder[0][dir]
then you can do this on your controller that your ajax url point to :you need isset because at inisialization both of those payload is not exist yet until you sort thru table header
Super - thanks for posting back.
Allan