1
我有一个窗体域,我想阅读的文本输入到它,我想下面的代码:读一个表单域在煎茶触摸ExtJS的
this.searchButton = new Ext.Button({// The button press will invoke the search action
text: 'Go',
handler: this.searchButtonTap,
scope: this
});
this.topToolbar = new Ext.form.FormPanel({
items: [
{xtype: 'textfield',
name: 'search',
placeHolder: 'Search'},
this.searchButton
]
});
searchButtonTap: function() {
// console.log(this.topToolbar.items.items[1]);
var currentText = AsApp.views.AsListView.getRecord();
console.log(currentText);
},
请你定义myTextField将事情,这是什么是指在上述情况下。 – whatf
myTextField可以指向任何文本字段。我假设你的“this.topToolbar.items.items [1]”指向它,但是在你的处理程序中,因为你已经将范围传递给它了,所以你应该可以像“var currentText = this.getValue();”从你的searchButtonTap函数中。 –