Hey All,
Is there a way to sort numeric text in an appropriate fashion (and not like 10,109,21,240,3)?
Thanks,
SKH
Hey All,
Is there a way to sort numeric text in an appropriate fashion (and not like 10,109,21,240,3)?
Thanks,
SKH
are you setting the field as type : 'INT" ?
https://moduscreate.com/wp-content/t...es/favicon.png
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
No...as a string...was kind of hoping there would be a way to handle this with a configuration option. I tried setting the sortType in the fields configuration object to 'asInt', but it had no effect.
try this simple sorter:
function sortNumber(a,b) {
return b - a;
}
var n = ["10", "5", "40", "25", "100", "1"];
console.log(n.sort(sortNumber));
https://moduscreate.com/wp-content/t...es/favicon.png
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
Okay...where or how do I implement this sorter? I have a JsonStore with dates, alphanumeric data and numbers (all received as strings) that feeds a grid on a report page. I was able to get the dates to sort by setting the dateFormat property to "m/d/Y' within the JsonStore. Where or how do I configure this sorter to apply only to the number fields?