PDA

View Full Version : GridPanel Client side Sorting



v.madhu
6 Jul 2010, 2:30 AM
Hello,

In my GridPanel i have a TEXT column which has empty String as well as decimal values.

On doing Sorting, the below code considers the priority of empty string and zero as same. (so i am getting incorrect result).


asFloat : function(s) {
var val = parseFloat(String(s).replace(/,/g, ""));
return isNaN(val) ? 0 : val;
}

so i changed the code as


asFloat : function(s) {
var val = parseFloat(String(s).replace(/,/g, ""));
return isNaN(val) ? -9999 : val;
}

please tell the logic is correct to change the priority of NAN values.