Sort by a specific value

Asked

Viewed 72 times

3

I’m using the plugin Datatables and in a column I possess the following structure

JSFIDDLE

And by default the plugin creates the default sort form that I don’t know which rule you obey, I would like when you click on this column to sort it by class value .saldo

How can I do that?

  • When you click on Information and the arrow is up the sorting it does and the crescent using its .saldo as a basis, I put the values 1,5,2, in the first ordering the 5 that was in the middle goes to last for being greater than 2

  • But these values need to be together in the same column ? http://jsfiddle.net/o037az6v/2/

  • No, it’s just that the actual structure is a little more complex, so I used the reduced example... Each column would be each store and the rows would be sales per product, so I need to have all this information on that td @Diegosouza

1 answer

0

I solved my problem using the attribute data-order that it is possible to customize the value used at the time of the order

Visualized in JSFIDDLE

Documentation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.