Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Answers
    3898
    Vote Rating
    1269
      0  

    Default

    What is App.view.MenuItem?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Tags for this Thread

Posting Permissions

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