How do I get the column name for sorting from database instead use of datatable inbuilt asc/desc
How do I get the column name for sorting from database instead use of datatable inbuilt asc/desc
pavan.a
Posts: 10Questions: 5Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Those prompts are provided for a reason. Ignoring them is no way to get help.
so how do I get column name while click on column head for desc or asc?
Are you using server side processing (
serverSide: true
)? Or are you doing your own custom script for sorting?Kevin
Hello @kthorngren , (serverSide: true) was a little bit helpful but I am trying to make a csutom sorting and pagination. I have tried 2 different approaches. on in comment and other is uncomment. I am posting my code here. Please help me with that.
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
Server side processing is a Datatable protocol for paging. The protocol is documented here. You don't want to use
serverSide: true
if your server script does't use this protocol. You can look at and use the Datatables example PHP script found here.Is this what you want to use or do you want to create your own?
If you have specific questions we will try to help. Likely you will need to post a link to your page or a running test case so we can interact with your code. Simply posting code and asking for help isn't going to yield much help.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thanks @kthorngren . Refered serverSide : true related solutions and I found what I need.