form component

我们在form loadData完成之后它便可以把值设置到相应的字段去.   通过formpanel.form.findField(fieldName)  找到对应的Ext的component . 
可以看formfindField()的实现 <pre><code class="javascript">
这是在 Ext.form.BaseForm 里面实现的.
findField : function (id) {
    var field = this.items.get(id);
    if (!field) {
        this.items.each(function (f) {if (f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)) {field = f;return false;}});
    }
    return field || null;
}
其中 this.items.each 这里的items 是在构造formpanel的时候,
  利用
onAdd : function(ct, c) {  // Ext.form.formPanel  (Form.js)
// 判断此component是不是formField,是否添加到this.form列表里面,待formpanel 的setValues 时把值设置到对应的component里面。
if (c.isFormField) {
this.form.add(c);
}
},

</code>
</pre>

你可能感兴趣的:(C++,c,ext,C#,F#)