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函數中。 –