0

I am working in extjs4 mvc.I am getting stuck at a point where I want to handle event when tab panels tab going to changed.I am using MVC structure in extjs4. I am tried with tab change event but it never get fired when tab is changed.please give me some advise how to handle such condition...

here is my some code:-- 1) my view file :---

Ext.define('am.view.center.centerTab',{
    extend:'Ext.tab.Panel',
    id:'centerTabId',
    frame:true,
    flex:1,
    alias:'widget.CenterTab',
    minTabWidth: 200,
    border: 0,
    style: {
        borderColor: 'white',
        //borderStyle: 'solid'
    },
    items:[
           {
               title:'Tab1',

           },
           {
               title:'Tab2',

           },
           {
               title:'Tab3'
           }
           ]//end of items
});// End of login class

2) And here is my controller file some code :---

              ------     
      'CenterTab':
                  {
                      tabchange:this.tabChaged1
                  }   
              }); //end of control
  },//end of init function

  tabChanged1:function()
  {
      console.log("tab changed");
  },

My requirement is whenever tab is chaged then the tabchange event get handled and particular function is called... Please give me some advise...

Pravin Mane
  • 529
  • 4
  • 13
  • 25
  • I'm pretty sure it is the `tabchange` event, like you have above. – Rob Mar 21 '13 at 07:37
  • I am using it but it is not going to handle it.Can you please explain me how to use it? – Pravin Mane Mar 21 '13 at 07:41
  • Well exactly like you have in your controller, you only misspelled the function... `this.tabChaged1` should be `this.tabChanged1`.. – Rob Mar 21 '13 at 07:43
  • thanks rob.Its silly mistake.Thanks a lot.And is it possible to display image on the backgorund of each tab? I used with css but it would not work.U have any suggestions how to use it? – Pravin Mane Mar 21 '13 at 07:48
  • CSS should work, but it takes some practice. For example: you have to make the background of a card transparent to be able to see the background of your `body`. – Rob Mar 21 '13 at 07:51

1 Answers1

0

You have misspelled the function name in your controller.

tabchange: this.tabChaged1 should be tabchange: this.tabChanged1

Rob
  • 4,927
  • 12
  • 49
  • 54
  • There's a [campaign to clean up Stack Overflow](http://meta.stackexchange.com/q/167342) by removing these typo-related questions - we could really use your help! Would you mind pitching in a little by casting a close vote on this question? – egerardus Mar 21 '13 at 18:54