javascript - Bootstrap DataTables1.10 currency sorting not working -
sample of how 1 row of currency value formatted prior passing table.
var client = new client(); //get data json item, //format data $##,##.##, add row object client.amount = item.famt.formatmoney(2, "$", ",", "."); results in client.amount = "$500,000.000" etc; //add object dataset dataset[loop]=client; datatable snippet
.datatable({ "data": dataset, "columns": [ {"title": "amount", classname:"text-center", data:"amount"}, .. ] }); the data displays in column doesn't sort. seems data being treated text when sorting , not currency. read version 1.10 automatically deals currency.
i found solution: under circumstances values passed table not formatted currency ($0,000.00) , caused values column treated string.
Comments
Post a Comment