Extjs排序问题——在线等
在Ext中有GroupingStore,其中有个配置项是sortInfo,但是该配置项的排序是按照中文字幕进行排序的,即使我为其分配的字段是数字类型的,请问有没有办法做到按照数字顺序进行排序?我应该怎样做处理?谢谢 --------------------编程问答-------------------- --------------------编程问答-------------------- 我一般是是在onBeforeload里做排序的事情。onBeforeload : function(store, operation, eopts) {
store.sort([ {
property : 'name',
direction : 'ASC'
} ]);
}
--------------------编程问答-------------------- 数字的话,可以
records.sort( function(a, b) {
var indexa = a.get('name');
var indexb = b.get('name');
return indexa - indexb;
} ); --------------------编程问答-------------------- 楼上正解11111
补充:Java , Web 开发