Add Dynamically A View in another View

女生的网名这么多〃 提交于 2019-12-11 16:19:43

问题


I have created a view

Ext.define("App.view.leaders.MyViewName", {
    extend: 'App.view.basePopup',
    xtype: 'MyViewName',
    config: <Ext.form.IPanel>{
        scrollable: 'vertical',           
        items: [
            {
                 xtype: 'fieldset',
                 title: 'Add New Auto Asset',
                 instructions: '<hr class="separate" />',
                 items: [
                     <Ext.field.ISelect>{
                         xtype: 'selectfield',
                         label: 'Borrower Position',
                         store: 'BorrowerPositionSelectorStore',
                     },
                     <Ext.field.ISelect>{
                         xtype: 'selectfield',
                         label: 'Asset Type',
                         store: 'AssetTypeSelectorStore',
                     },
                     {
                         xtype: 'textfield',
                         name: '',
                         label: 'Description'
                     },
                     {
                         xtype: 'numberfield',
                         name: '',
                         label: 'Value'
                     }                               
                 ]
             }
         ]
    }
});

and an instance of that view in a controller like:

var newObject = Ext.create("App.view.leaders.MyViewName");

and add it to another view dynamically like this:

var newAdd = this.getLeadDetail1003()
                 .down('leadDetail1003AssetsLiab')
                 .down('fieldset[itemId=AddCashAsset]');

newAdd.add(newObject);

but it is not added to the form! Can anyone please tell me what am I doing wrong or what I need to do now?

来源:https://stackoverflow.com/questions/26353155/add-dynamically-a-view-in-another-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!