PDA

View Full Version : Issues with Ext.Button working in Chrome, Safari but not Firefox



roko
24 Dec 2010, 8:42 AM
I currently have an application where in the Ext.onReady function I'm creating a few Ext.Buttons and be applied to some specific div tag which is defined in my page. This works just fine in Chrome and Safari but in Firefox the buttons never appear. I'm currently using version 3.3.1 of ExtJS.This is what the Ext.onReady call looks like:



Ext.onReady(function() {
new Ext.Button({text: '<div style="font-weight:bold;">Purchase Now!</div>',
handler: purchaseMule,
applyTo: premiumMulePurchaseButton,
width: 100,
height: 35,
id: 'premiumMule'}); });

My div tag is defined like the following:
<div id="premiumMulePurchaseButton"></div>

Any help is greatly appreciated.

Condor
24 Dec 2010, 9:32 AM
And you do this from Ext.onReady?

ps. I would recommend using css to make the button text bold, instead of adding an extra div.

rkruze
27 Dec 2010, 9:02 AM
Yep, doing it all from Ext.onReady(). Also thank you for the tip!

skirtle
27 Dec 2010, 10:01 AM
I think you're missing quotes on your applyTo. This works for me:


applyTo: 'premiumMulePurchaseButton',

Some browsers automatically create global variables named after the ids of DOM elements, so on those browsers it will work without the quotes.

Are you running Firebug on Firefox? It picked up the problem line straight away.