PDA

View Full Version : Ext.query coming up empty in afterrender event handler



bimargulies
25 Jul 2012, 8:17 AM
First I set an afterrender handler on a tab I am adding to a tab panel.



var newTab = docTabs.add({
title: label,
html: fullResp.documentViewHtml,
closable: true


});
newTab.addListener("afterrender", controller.addedTab);


It's called. In there, I have:



function handler (that) {
var languageRegions = Ext.query("span", that.getEl());
}


It returns an empty array. There are spans down there.

friend
25 Jul 2012, 9:08 AM
Change this:



function handler (that) {
var languageRegions = Ext.query("span", that.getEl());
}


to this:



function handler (that) {
var languageRegions = Ext.query("span", that.getEl().dom);
}