Sorting not working properly when using colums.render
Sorting not working properly when using colums.render
I want to add '/kg' behind the price and i tried to achived it by using colums.render and it works just fine but when i try to sort the price colum it didn't sort the right number
this is what try to do to achived it:
columns: [{
data: 'tanggal'
}, {
data: 'produk'
}, {
data: 'harga', // price
render: function(data, type, row, meta) {
return '<span>' + $.fn.dataTable.render.number('.', ',', 2, 'Rp. ').display(data) + ' /kg' + '</span>';
}
}, {
data: ''
}],
This question has an accepted answers - jump to answer
Answers
For this sort of thing you will want to use orthogonal data - e.g.:
Allan
Thanks a lot allan it works like a charm! I really appreciate the help