Results 1 to 4 of 4

Thread: How to call one view fom another, so that another view gets rendered and first hides?

  1. #1

    Default How to call one view fom another, so that another view gets rendered and first hides?

    How to call one view fom another, so that another view gets rendered and first hides?

  2. #2
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124

    Default

    Hi,

    may you provide your code for better understanding the problem
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3

    Default

    I am having two classes:
    License Agreement and MainMenu.
    I need to call Main Menu when i click a button on License Agreement.

    License Agreement.js I have highlighted the place where the code needs to go in.)





    var mainScreen = Ext.define('FieldSales.view.LicenseAgreement', {
    extend: 'Ext.tab.Panel',
    xtype:'LA',
    requires: [
    'Ext.form.Panel',
    'Ext.form.FieldSet',
    'Ext.field.Number',
    'Ext.field.Spinner',
    'Ext.field.Password',
    'Ext.field.Email',
    'Ext.field.Url',
    'Ext.field.DatePicker',
    'Ext.field.Select',
    'Ext.field.Hidden',
    'Ext.field.Radio',
    'Ext.field.Slider',
    'Ext.field.Toggle',
    'Ext.field.Search',
    //'FieldSales.view.MainMenu',
    ],


    config: {
    fullscreen: true,
    activeItem: 0,
    tabBar: {
    // docked: 'bottom',
    ui: 'neutral',
    layout: {
    pack: 'center'
    }
    },
    items: [
    {
    title: 'Field Service App',
    xtype: 'formpanel',
    id: 'basicform',
    iconCls: 'refresh',
    items: [
    {
    xtype: 'fieldset',
    //title: 'Personal Info',
    // instructions: 'Please enter the information above.',
    defaults: {
    labelWidth: '100%'
    },
    items: [
    {
    xtype : 'textfield',
    name : 'name',
    label : 'sasssssssssss',
    //scrollable : true,
    // placeHolder : 'Tom Roy',
    // autoCapitalize: true,
    // required : true,
    clearIcon : true
    },
    ]
    },
    {
    xtype: 'panel',
    defaults: {
    xtype: 'button',
    style: 'margin: 0.1em',
    flex : 1
    },
    layout: {
    type: 'hbox'
    },
    items: [
    {
    text: 'Enquiry',
    scope: this,
    handler: function(btn){

    }
    },
    {
    text: 'Agree',
    handler: function(){
    Ext.create('FieldSales.view.MainMenu');

    }
    }
    ]
    }
    ]
    },
    ]
    }
    });

    MainMenu.js:



    Ext.define('FieldSales.view.MainMenu', {
    extend: 'Ext.Container',
    xtype:'MM',
    config: {


    fullscreen: true,
    activeItem: 0,
    tabBar: {
    // docked: 'bottom',
    ui: 'neutral',
    layout: {
    pack: 'center'
    }
    },


    layout: {
    type : 'vbox',
    pack : 'center',
    align: 'stretch'
    },
    cls : 'card1',
    defaults: {
    xtype: 'container',
    flex : 1,
    layout: {
    type : 'hbox',
    align: 'middle'
    },
    defaults: {
    xtype : 'button',
    flex : 1,
    margin: 10
    }
    },
    items: [


    {
    items: [
    {text: 'Accounts Near Me'},
    ]
    },
    {
    items: [
    {text: 'Opportunities Near Me'},
    ]
    },
    {
    items: [
    {text: 'Submit Case'},
    ]
    },
    {
    items: [
    {text: 'Knowledge Articles'},
    ]
    },
    {
    items: [
    {text: 'Info'},
    ]
    },
    {
    items: [
    {text: 'Contact'},
    ]
    }
    ]
    }
    });

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    21
    Answers
    2

    Default

    Instantiate the second view with
    hidden : true in its config, then show() it later.

    And please use CODE tags next time you post more than one line of source code, makes it much more readable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •