Ext store 中文排序问题补丁
情景说明:
store从数据库中加载有序的数据,在前台根据业务需要将其中一部分删除后,又添加了一部分后,调用
Ext.data.Store.prototype.applySort = function() {if (this.sortInfo && !this.remoteSort) {var s = this.sortInfo, f = s.field;var st = this.fields.get(f).sortType;var fn = function(r1, r2) {var v1 = st(r1.data[f]), v2 = st(r2.data[f]);if (v1 == null) {v1 = "a";}if (v2 == null) {v2 = "a";}if (typeof(v1) == "string") {return v1.localeCompare(v2);}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);}}};