PDA

View Full Version : [CLOSED] Add event to tab from client side code



matrixwebtech
Jul 20, 2014, 4:04 PM
I add tabs to tabpanel with bellow code


var AddTab = function (tabPanel, URL,TITLE) {


var tab = tabPanel.add({

title: TITLE,
closable: true,
loader: {
url:URL,
renderer: "frame",
loadMask: {
showMask: true,
//msg: "Loading " + record.data.text + "..."
}
},
autoScroll: false,
border: false,
height:600
});


tabPanel.setActiveTab(tab);
};

how I declare close and active event for this tab in this script?

Daniil
Jul 21, 2014, 12:53 PM
Hi @matrixwebtech,

How would you define them for an <ext:Panel> via markup?


<ext:Panel runat="server">
<Listeners>
<Activate Handler="onActivate" />
</Listeners>
</ext:Panel>


You could run a simple .aspx containing that Panel in the <body> and see the rendered JavaScript. Open Page Source in a browser and search for this script.

Ext.onReady(function() { ... });

Inside that script you will find a listeners section.