首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Ext store 中文排序有关问题补丁

2012-11-05 
Ext store 中文排序问题补丁情景说明:store从数据库中加载有序的数据,在前台根据业务需要将其中一部分删除

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);}}};

热点排行