question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dir does not change in Ajax Sorting - Always sends dir=asc

See original GitHub issue

Hi There,

Ajax sorting is not working properly for me. When I click for the first time then it sends {column: Id, dir: asc}, when I click again on the same column just after ideally it should send {column: Id, dir: desc} but it is again sending the same object {column: Id, dir: asc}.

Below, is the code snippet which I am using

var tabulatorData = [
	{title: 'Id', field: 'Id', headerSort:true},
	{title: 'Name', field: 'Name', headerSort:true},
	{title: 'Age', field: 'Age', headerSort:true},
];

$("#user-table").tabulator({
    pagination:"remote",
    paginationSize : 50,
    layout:"fitDataFill",                            
    placeholder:"No Data Set",
    height:"400px",
    columns: tabulatorData,
    ajaxURL:"user-records", 
    ajaxSorting:true,
    ajaxParams:{index: 'active'}
   
});

Am I missing something?

Please, help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aditya-nxcommented, Dec 5, 2017

Hay @olifolkerd

Thanks a lot. It is working perfectly now. 👍

0reactions
olifolkerdcommented, Dec 4, 2017

I think I have gotten to the bottom of this, I pushed a fix to it to master back in October but completely forgot to do an official release for it, I have just released patch fix 3.3.2 which includes the fix for this,

Let me know if you are still having issues after the update.

Cheers

Oli

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kendo datgrid not sending sort field parameter to server
I have a kendo datagrid that retrieves data through an ajax transport. The paging features work perfectly. However, the control keeps sending a ......
Read more >
Custom server side sorting in Kendo UI for jQuery - Telerik
Hello I want to completely control the server side sorting of my grid. Meaning, when I click a column header, I don't want...
Read more >
order:[[5,'desc']] ajax dosent set the value for order[0][column ...
i want my datatable to be sorted on first load of page so is ... but it is not setting value for order[0][column]=5...
Read more >
How To Sort a List - W3Schools
Learn how to sort an HTML list, using JavaScript. ... Start by saying there should be no switching: shouldSwitch = false; /* Check...
Read more >
Jquery Datatable Ajax Tutorial With Example Project
Basically all of the filtering, paging, sorting, changing page length, etc. and DataTables is just an event and display module.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found