簡體   English   中英

Extjs表單 - 未定義findField

[英]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

findFieldExt.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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM