PDA

View Full Version : this.btnEl = btn.child(this.buttonSelector); is returning "null"



AvTrax
22 Sep 2011, 1:04 PM
I am very new to Ext, so please forgive me if this question is stupid.

On the page I am working on the user can right click and a menu will drop down with an option to search by "choose date" and a Calendar should pop out to choose a given date.



Browser.ContextMenu.addItem([{
text: "Choose Date",
iconCls: "icon-calendar",
menu: {
xtype: "datemenu",
handler: function(picker, date){
location.href = location.pathname+"?m=flifo_aircraft&dep_cal="+date.format("dMY").toUpperCase();
}
}
}


Now it looks like the browser is trying to populate the calendars table with a button:



this.mbtn = new Ext.Button({
renderTo: this.el.child('td.x-date-middle', true),
text: ' ',
tooltip: this.monthYearText
});


Then when it tries to render this button with:



this.btnEl = btn.child(this.buttonSelector);
this.mon(this.btnEl, {
scope: this,
focus: this.onFocus,
blur: this.onBlur
});


but in here this.btnEl is "null" which then in turn causes the "mon" function to miss fire and kick out. Which I assume is causing the calendar to not populate with data. I tried commenting out the "this.mbtn" hoping that it was just that button but then the "this.todayBtn" produced the same error



this.todayBtn = new Ext.Button({
renderTo: this.el.child('td.x-date-bottom', true),
text: String.format(this.todayText, today),
tooltip: String.format(this.todayTip, today),
handler: this.selectToday,
scope: this
});


So I think it might be in the Ext.Button that is causing the problem and I know that the person who occupied my position before me, did edit ext-all.js to better fit the site but I have checked all of "Ext.Button=" and is is the same as the standard ext-all.js 3.0.0 "Ext.Button=".

Please help me I don't know where else to look.