【发布时间】:2015-04-23 17:43:59
【问题描述】:
Extjs 5.
我的应用有一个带有标签字段的表单,其中包含 200 多个项目的列表。
其中大约 30 个项目包含“另一件事”(例如)。 每次我选择其中一项时,都应该将一个文本区域动态添加到表单中。
我尝试了多种解决方案但均未成功,包括使用 match()、indexOf() 和 search() javascript 方法。
onSelect : function (combo, records, eOpts) {
var records = combo.getValue();
for (var i = 0, count = records.length; i < count; i++) {
while( records[i] == '%another thing%'){ //I know this is not the right way; Just to show what I'm looking for
console.log('OK'); //logic...
return;
}
}
},
我将不胜感激。
提前致谢。
【问题讨论】:
-
你能在Sencha Fiddle上发布一个例子吗?另外,我不太确定 while 循环的目的是什么……这看起来很奇怪。
-
感谢您帮助 incutonez。
标签: extjs5