0
votes

The controller function

 startpage:function(a){
              var model1 = this.store.getAt(a.index);   
              App.views.start.load(model1);
              App.views.viewport.reveal('start');
            },

how to get the loaded model1 values in the start page how can i able to pass parameter from controller to a page

App.views.start = Ext.extend(Ext.form.FormPanel, {

    initComponent: function(){}
}
1

1 Answers

0
votes

As your extending the FormPanel, I believe Sencha will pre-populate your fields.

Your code will looking something similar to this:

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);

Note that you will have to substitute in your actual fields and you'll probably need to customise the form somewhat.