PDA

View Full Version : How to get Div-id on Active Tab



biggi
16 Dec 2009, 3:32 PM
Hi all,

I have two Tabpanels, each panel has the following content


<dl id="x-shortcuts">
<dt id="products-win-shortcut" class="left">
<a href="#"><img src="/lib/s.gif" />
<div>Products</div></a>
</dt>

<dt id="reviews-win-shortcut" class="right">
<a href="#"><img src="/lib/s.gif" />
<div>Reviews</div></a>
</dt>
</dl>Click on icon called a new window.
The problem is to distinguish which panel is active and invoke window on only the active Tabpanel.


var shortcuts = Ext.get('x-shortcuts');
if(shortcuts) {
shortcuts.on('click', function(e, t) {
if(t = e.getTarget('dt', shortcuts)) {
e.stopEvent();
var module = t.id.replace('-shortcut', '');
var winTitle = e.getTarget('div', t);
if(module){
zentoNewWindow(module,winTitle);
}
}
});
}How can i make it?
The active Tabpanel i get with


var activeTab = Ext.getCmp('center-panel').getActiveTab();But how can i connect it together?

biggi
17 Dec 2009, 5:04 AM
nobody an idea?

Animal
17 Dec 2009, 5:16 AM
Each TabPanel has the following content?

What, with the same IDs?

biggi
17 Dec 2009, 5:20 AM
Thanks

no the Tabpanel 1 has content

<dl id="x-shortcuts">
<dt id="products-win-shortcut" class="left">
<a href="#"><img src="/lib/s.gif" />
<div>Products</div></a>
</dt>

<dt id="reviews-win-shortcut" class="right">
<a href="#"><img src="/lib/s.gif" />
<div>Reviews</div></a>
</dt>
</dl> and the another Tabpanel has content


<dl id="x-shortcuts">
<dt id="customers-win-shortcut" class="left">
<a href="#"><img src="/lib/s.gif" />
<div>Customers</div></a>
</dt>
</dl>

evant
17 Dec 2009, 5:22 AM
id's need to be unique across the document, you can't use them twice.

biggi
17 Dec 2009, 5:28 AM
That is my problem, my function read from id "x-shortcuts".