I have a problem with tabulator sort, when I use a one column formatter, and I multiply the value.
Sorting takes the initial value and not the value resulting from the multiplication, so the sorter is wrong.
formatter: function(cell, formatterParams) {
var value = cell.getValue();
if (cell.getRow().getData().Tipo == 'Holfuy') {
value=cell.getValue()*5;
return value;
} else {
return value;
}
},
Thanks for the help.
This is happening because Tabulator formatters are visual only, they do not affect the underlying data used for sorting and filtering.
If you want the updated value to be included in the sort then you need to use a mutator not a formatter.
This will then convert the underlying data and will work when sorted:
Full details can be found in the Mutator Documentation