[英]ExtJs tagfield sort visible value
Maybe someone can help me to sort selected items. 也许有人可以帮我分类选定的项目。 By default new selected is added to the end of array.
默认情况下,新选择将添加到数组的末尾。
I would like to show them alphabetically, is it possible to do? 我想按字母顺序显示它们,是否可以这样做?
I tried to set some listeners on change
but this event is called after selected item is shown on the component. 我尝试在
change
设置一些侦听器,但在组件上显示所选项目后调用此事件。
Any help, or sugestion? 任何帮助,或消化?
I just did this today! 我今天就这样做了!
Add a listener on select, and sort them there: 在select上添加一个监听器,并在那里对它们进行排序:
...
"listeners": {
"select": function(combo, records){
records.sort(function(a, b){
//Change value to text or whatever field you want to sort on
return a.data.value - b.data.value;
});
combo.setValue();
combo.setValue(records);
}
},
...
Cheers 干杯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.