View Full Version : Ext.MasterTemplate is not a constructor

2 Aug 2007, 8:57 AM
I'm trying to build my own ext, but the resultant file is throwing this error when using the ColorMenu:

Ext.MasterTemplate is not a constructor

I've checked 'em all (the boxes), but still the same problem.

2 Aug 2007, 9:02 AM
post code please.

2 Aug 2007, 9:28 AM
You are obviously building with the 2.0 code base since MasterTemplate was recently moved into the legacy folder in 2.0, which is why that is now failing. There's no guarantee with 2.0 that stuff like this won't happen during development, it's one of the joys of dealing with pre-alpha code. You'll either have to roll back to a previous build, wait for ColorMenu to be updated, or try to fix it yourself.

2 Aug 2007, 10:57 AM
I'm slightly confused... I'm using the "build your own Ext" on this web site, and the example code in the docs, which I assume is on the 1.1 release?

2 Aug 2007, 11:03 AM
var tB = new Ext.Toolbar(tA);

var onButtonClick = function(btn){ alert('yo'); };
var onItemClick = function(item){ alert('yo'); };

new Ext.Toolbar.MenuButton({
text: 'Text Formatting',
handler: onButtonClick,
tooltip: {text:'This is a QuickTip with autoHide set to false and a title', title:'Tip Title', autoHide:false},
cls: 'x-btn-text-icon',
// Menus can be built/referenced by using nested menu config objects
menu : {items: [
{text: '<b>Bold</b>', handler: onItemClick},
{text: '<i>Italic</i>', handler: onItemClick},
{text: '<u>Underline</u>', handler: onItemClick}, '-',{
text: 'Pick a Color', handler: onItemClick, menu: {
items: [
new Ext.menu.ColorItem({selectHandler:function(cp, color){
Ext.example.msg('Color Selected', 'You chose {0}.', color);
}}), '-',
{text:'More Colors...', handler:onItemClick}
{text: 'Extellent!', handler: onItemClick}

2 Aug 2007, 1:32 PM
It looks like MasterTemplate should be included in the BYO dependency list for ColorMenu and it's missing. We'll get that fixed. For now, you can try including MasterTemplate.js directly, or using JS Builder to build your own rather than the website.

4 Aug 2007, 9:14 PM
This has been fixed -- please rebuild using the BYO page and let us know if you're still having any issues.

5 Aug 2007, 6:20 PM
Thanks very much, I'll give it a go. I have a related request... Could the BYO page print out the ordered list of files it is going to pack? In my situation, we're going to be putting the main ext files and selected controls on "every page" in one package, and then the rest of the controls used "deeper" on the site in another. I looked at the jsbuild files, and that can work, but I lose the nice dependency computation that BYO gives me.

We're making good progress on our big move from MS Ajax to Ext JS, hoping I can finish it up and then become an ExtJS paying customer!

5 Aug 2007, 6:21 PM
On another related note, I'm using Dojo ShrinkSafe to pack all my stuff up, including the ext libs. Any known issues with this? So far so good.

5 Aug 2007, 7:57 PM
Should be fine. We actually use ShrinkSafe ourselves sometimes also with good results.