Reset to initial state and do sort by current column
Reset to initial state and do sort by current column
Fedar
Posts: 6Questions: 2Answers: 0
I have a table. But I want to sort a dataset from left to right. I do not want take into account state of the data of the previous sorting. How can i do it?
var table = $('.total');
var sTable = table.DataTable({
searching: false,
bLengthChange: false,
bInfo: false,
paging: false,
});
This discussion has been closed.
Answers
something like this?
http://live.datatables.net/seqatati/1/edit
No. As if understand right, next sorting is based on current state of the dataset. Ex. If I have two row with data Alex, 20 and Anthony, 20. After sorting by Name Alex will be in first place, and after sorting by Age and again by Name - Alex will be in second place
That's is not what is happening in my example. Added AAlex and AAnthony. it does not matter what you click on, when you click on name, they end up in the right order.
http://live.datatables.net/seqatati/2/edit
http://live.datatables.net/jeyozive/1/edit
Initial state: 1. AAlex, 2. AAnthony, 3. Ashton Cox
Click Name, next click Age.
Result: 1. AAnthony, 2. Ashton Cox, 3. AAlex,
I think for next sorting a plugin get previous state of the data (Name: desc). But i want to reset state and do sorting.
Thank you, bindrid. Your help is very important for me.
I found a solution:
https://datatables.net/forums/discussion/42635/how-process-a-sorting-if-x-y#latest