Jul 25, 2011, 5:35 PM
Below is how I intend to use the sortFunctionHandler. The sortType cannot be used here as it accepts only one parameter.
http://www.sencha.com/forum/showthre...endent-sorting.
So I need to make modification to the source code and recompile to be able to extend the recordfield class . Is that what you are saying? your example was not clear to me.
Regards
Ext.net.Store.override({
applySort: function () {
if (this.sortInfo && !this.remoteSort) {
var s = this.sortInfo, f = s.field;
var st = this.fields.get(f).sortType;
var fn = this.fields.get(f).sortFunction || function (r1, r2)
{
var v1 = st(r1.data[f]), v2 = st(r2.data[f]);
return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
};
this.data.sort(s.direction, fn);
if (this.snapshot && this.snapshot != this.data) {
this.snapshot.sort(s.direction, fn);
}
}
}
});
function MySortFunction(v1, v2) {
var st1 = v1.data['name'], st2 = v2.data['name'];
return (st1.localeCompare(st2));
}
What I want to achieve is similar to what is done herehttp://www.sencha.com/forum/showthre...endent-sorting.
So I need to make modification to the source code and recompile to be able to extend the recordfield class . Is that what you are saying? your example was not clear to me.
Regards