控制器函数
startpage:function(a){
var model1 = this.store.getAt(a.index);
App.views.start.load(model1);
App.views.viewport.reveal('start');
},如何在起始页中获取加载的model1值如何能够将参数从控制器传递到页
App.views.start = Ext.extend(Ext.form.FormPanel, {
initComponent: function(){}
}发布于 2011-11-21 17:47:43
作为对FormPanel的扩展,我相信Sencha会预先填充您的字段。
您的代码将如下所示:
App.views.start = Ext.extend(Ext.form.FormPanel, {
initComponent: function(){
var fields = {
xtype: 'fieldset',
id: 'a-form',
title: 'A Form',
instructions: 'Some instructions',
defaults: {
xtype: 'textfield',
labelAlign: 'left',
labelWidth: '40%'
},
items: [
{
name : 'title',
label: 'title',
xtype: 'textfield'
},
{
name: 'email',
label: 'email',
xtype: 'emailfield'
}
]
};
Ext.apply(this, {
scroll: 'vertical',
items: [ fields ]
});
App.views.start.superclass.initComponent.call(this);
}
}
Ext.reg('App.views.start', App.views.start);请注意,您必须在实际字段中进行替换,并且可能需要对表单进行一些自定义。
https://stackoverflow.com/questions/8209503
复制相似问题