我正在为自定义 FilteringSelect 小部件商店中的项目添加标签属性,以便它们显示为带有图标。
var data = this.store.data;
for ( var i = 0; i < data.length; i++ ) {
data[i].label = data[i].needsIcon ? "<div class='labelIcon'></div> " : "";
data[i].label += data[i].value;
}
This is all good for displaying the icon in front of items in the dropdown, but when an item is selected, the label is now part of the object. 有没有办法修改自定义小部件,使其返回没有“标签”属性的项目:
var myItem = customSelectWidget.item; // How to return the item without "label"???