I found a solution for my problem. I created a hidden column with numeric values. The sorting will be based in this column. This is the custom sort function
// Custom function to sort Column by another Column
var mysortFunction = function(a, b, desc) {
// Deal with empty values
if(!YAHOO.lang.isValue(a)) {
return (!YAHOO.lang.isValue(b)) ? 0 : 1;
} else if(!YAHOO.lang.isValue(b)) {
return -1;
}
// compare column values
var comp = YAHOO.util.Sort.compare;
var compState = comp(a.getData("myhiddenColumn"), b.getData("myhiddenColumn"), desc);
return compState;
};
And the column defs :
var myColumnDefs = [
{ key: "A", sortable:true,hidden:true },
{ key: "columnToSort",label:"ABC", sortable:true, sortOptions: { sortFunction: mysortFunction }
{ key: "myhiddenColumn", sortable:true, hidden:true }
}
];
Hope this helps