[英]Extjs form - findField is not defined
我在Extjs中選擇一個表格如下:
var form = Ext.getCmp(mainTabsId).getActiveTab().down().getForm("add-form");
//I am getting here the correct id.
console.log(form.id);
但是當我試圖在里面找到一個字段時,我收到以下錯誤:
form.findField("Address").getValue();
Uncaught TypeError: Object [object Object] has no method 'findField'
這是http://pastebin.com/EuVizyCZ格式的console.log
findField
是Ext.form.Basic
一種方法,而不是Ext.form.Panel
......所以你必須這樣做:
form.getForm() // get the BasicForm ref
.findField('Address')
.getValue();
更新
通過猜測你的代碼,我會嘗試:
// supposing add-form is the id or itemId of a FormPanel
Ext.getCmp(mainTabsId).getActiveTab().down('#add-form').getForm()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.