Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding click events to a Tab in Ext JS
    primarykey
    data
    text
    <p>Aloha again, SO.</p> <p>I'm busy working on a project that is pretty much all ExtJS for the frontend work. I'm using version 4.0.0, presuming that is something necessary to know. I've got some code along the following:</p> <pre><code>panel = Ext.create("Ext.panel.Panel",{ //initializing stuffs }) </code></pre> <p>A few of those then</p> <pre><code> tabs = Ext.create("Ext.tab.Panel", { //initialize config items: [ //the panels ] }) </code></pre> <p>Now my big problem here is, I need to be able to bind an event to the actual tabs. I'm aware of being able to bind events to the tab panel and tab bar, but I need to actually bind the click event to one of the tabs in the panel. I tried something along the lines of this:</p> <pre><code>panel = Ext.create("Ext.panel.Panel", { //initializing stuffs listeners: { click: { fn: function() { console.log("in click listener for panel") } } } }) </code></pre> <p>However, the problem is, based on what I can tell, that binds to the actual panel itself, and not to the tab up in the tab bar. On an interesting side note, it actually doesn't even bind to the actual panel, as far as functionality is concerned, because I never see that console log information.</p> <p>In any case, would any of you here happen to know how to bind events directly to the tabs? Or even how to get access to the tabs directly? I've been sifting through the ExtJS API docs, but I still can't find anything, so, it'd be awesome if someone here could help! :D</p> <p>Just to make it clear, I'm not trying to hook into the tab changing. I'm trying to hook into the actual click event of clicking the tab, because I am going to be checking if it is the middle mouse button being clicked so I can close the tab if it is.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload