Sencha touch 在另一个视图中动态添加视图
我已经创建了一个视图Sencha touch 在另一个视图中动态添加视图,sencha-touch,sencha-touch-2.3,Sencha Touch,Sencha Touch 2.3,我已经创建了一个视图 Ext.define("App.view.leaders.MyViewName", { extend: 'App.view.basePopup', xtype: 'MyViewName', config: <Ext.form.IPanel>{ scrollable: 'vertical', items: [ { xtype: '
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'
}
]
}
]
}
});
并将其动态添加到另一个视图中,如下所示:
var newAdd = this.getLeadDetail1003()
.down('leadDetail1003AssetsLiab')
.down('fieldset[itemId=AddCashAsset]');
newAdd.add(newObject);
但它并没有添加到表单中!有谁能告诉我我做错了什么或我现在需要做什么吗?请避免类似和重复的问题如果你知道,请给我链接。。我现在还没有得到任何有用的链接。请添加以下内容并让我知道结果:console.log(this.getLeadDetail1003().down('leadDetail1003AssetsLiab')。down('fieldset[itemId=AddCashAsset]'))其引用该特定字段集,并在控制台上显示该字段集的所有属性。是的,你必须知道当我添加而不创建任何视图时,只需在newAdd.add({xtype:……许多其他…})中编写所有视图代码;它可以工作。请发布您试图添加的视图的代码。另外,
newObject
是否正确创建?
var newAdd = this.getLeadDetail1003()
.down('leadDetail1003AssetsLiab')
.down('fieldset[itemId=AddCashAsset]');
newAdd.add(newObject);