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 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,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

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

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

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
  •