1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Vote Rating
    0
    dev3 is on a distinguished road

      0  

    Default Unanswered: Load Panel from click of list in TabPanel in MVC Pattern

    Unanswered: Load Panel from click of list in TabPanel in MVC Pattern


    I have code in my app as bellow in which i load list within tabpanel on load

    app.js
    launch: function() {
    Ext.Viewport.add(Ext.create('App.view.Test1'));


    }

    Initview.js
    Ext.define('App.view.Test1', {
    extend: 'Ext.TabPanel',
    alias:'widget.MainTb',
    id:'MainTb',
    config: {
    fullscreen: true,
    ui:'TabUI',
    tabBar:{
    docked: 'bottom', // will put the menu on the bottom of the screen
    layout:{
    pack: 'center' // this will center the menu
    }

    },
    items:[{

    iconCls: "list",
    xtype:'list',
    id:"Menulist",
    title: '<span style="color:#886846;font-size:14px;">Menu</span>',
    pinHeaders:false,
    store:{
    fields: ['MainMenu'],
    data:[
    {MainMenu:'ROLL SPECIAL'},
    {MainMenu:'SUSHI/SASHIMI'},

    ]
    },
    itemTpl: '<div width="100%">{MainMenu}</div>',
    scrollable : 'vertical',
    listeners:
    {
    select: function(view, record) {
    OnMainMenuClick(record);
    }
    },
    onItemDisclosure:function(record,btn,index)
    {
    OnMainMenuClick(record);
    }

    }
    ]

    On click of list item i need to load another list / viewport



    function OnMainMenuClick(record)
    {
    //MainTb.hide();
    //MenuItem.show();
    Ext.Viewport.remove('App.view.Test1');
    Ext.Viewport.add(Ext.create('App.view.MenuItem'));
    mode ='MenuItem';
    SetItemSubMenuDetails(record.get('MainMenu'));

    }


    but it do nothing, and on second click gives message
    [WARN][Ext.Component#constructor] Registering a component with a id (`MenuItem`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.

    please help me how can i do this ?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    Answers
    3500
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What is App.view.MenuItem?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread