我在控制器上有这个方法
onResponsibleSuggestListTap: function (list, index, target, record, event, eOpts) {
var activityGeneral = this.getActivityGeneral();
//set the text field value
activityGeneral.down('#responsible').setValue(record.get('value'));
console.log(record.get('value'));
//hide out floating list
this.getResponsibleSuggest().destroy();
//clear the drop down list
this.onClearResponsibleField();
},
并在视图中:
items: [
{
xtype: 'container',
width: '60%',
padding: '0 3px 0 0',
items: [
{
xtype: 'searchfield',
itemId: 'responsibleSearchField',
placeHolder: 'introduces..."
}
]
}
]
但是我点击搜索字段中的项目后无法设置值,我做错了什么?
非常感谢!
答案 0 :(得分:1)
按以下方式尝试更改
activityGeneral.query('searchfield[itemId=responsibleSearchField]')[0].setValue(record.get('value'));