PDA

View Full Version : Problem with Ext 3.3



bozzoz
12 Oct 2010, 1:08 AM
Hello, all my applications made with the Designer does not work with the new Ext 3.3. There are problems with code generated by the designer and Ext 3.3?

jarrednicholls
12 Oct 2010, 9:45 AM
Really? That is very interesting indeed, as Ext 3.3 is meant to be backwards compatible without any breaking API changes. Can you give me an example of your project, and maybe some console error output from Web Inspector or Firebug? You should report this as a bug in the Ext forums.

bozzoz
12 Oct 2010, 11:30 AM
Hi Jarred this is one of my application ui



/*
* File: application.ui.js
* Date: Tue Oct 12 2010 21:04:51 GMT+0200 (CEST)
*
* This file was generated by Ext Designer version xds-1.0.2.14.
* http://www.extjs.com/products/designer/
*
* This file will be auto-generated each and everytime you export.
*
* Do NOT hand edit this file.
*/

applicationUi = Ext.extend(Ext.Viewport, {
layout: 'fit',
initComponent: function() {
this.items = [
{
xtype: 'panel',
title: 'Juza Site Admin',
style: 'padding:10px',
layout: 'fit',
autoScroll: true,
ref: 'app',
id: 'appContainer',
tbar: {
xtype: 'toolbar',
ref: '../appMenu',
id: 'appMenu',
items: [
{
xtype: 'button',
text: 'News',
icon: 'media/icon16/news.png',
id: 'btNews',
menu: {
xtype: 'menu',
itemId: 'menuNews',
ref: '../../../menuNews',
items: [
{
xtype: 'menuitem',
text: 'Elenco news',
icon: 'media/icon16/table.png',
itemId: 'menuElencoNews',
ref: '../../../../menuElencoNews'
},
{
xtype: 'menuitem',
text: 'Nuova news',
icon: 'media/icon16/new.png',
itemId: 'menuNuovaNews',
ref: '../../../../menuNuovaNews'
}
]
}
},
{
xtype: 'button',
text: 'Amministrazione',
icon: 'media/icon16/amministrazione.png',
itemId: 'btAmministrazione',
ref: '../../btAmministrazione',
menu: {
xtype: 'menu',
ref: '../../../menuAmministrazione',
id: 'menuAmministrazione',
items: [
{
xtype: 'menuitem',
text: 'Elenco utenti',
icon: 'media/icon16/table.png',
itemId: 'menuElencoUtenti',
ref: '../../../../menuElencoUtenti'
},
{
xtype: 'menuitem',
text: 'Nuovo utente',
icon: 'media/icon16/new.png',
itemId: 'menuNuovoUtente',
ref: '../../../../menuNuovoUtente'
},
{
xtype: 'menuseparator'
},
{
xtype: 'menuitem',
text: 'Categorie',
icon: 'media/icon16/table.png',
itemId: 'menuElencoCategorie',
ref: '../../../../menuNuovoUtente'
}
]
}
},
{
xtype: 'tbfill'
},
{
xtype: 'tbtext',
text: 'Benvenuto:',
itemId: 'welcomeMsg',
ref: '../../welcomeMsg'
},
{
xtype: 'tbseparator'
},
{
xtype: 'button',
text: 'Utente',
icon: 'media/icon16/user.png',
ref: '../../btUtente',
id: 'btUtente',
menu: {
xtype: 'menu',
ref: '../../../menuUtente',
id: 'menuUtente',
items: [
{
xtype: 'menuitem',
text: 'Logout',
icon: 'media/icon16/logout.png',
itemId: 'menuLogout',
ref: '../../../../menuLogout'
},
{
xtype: 'menuitem',
text: 'Cambia Password',
icon: 'media/icon16/key.png',
itemId: 'menuCambiaPassword',
ref: '../../../../menuCambiaPassword'
}
]
}
}
]
},
items: [
{
xtype: 'panel',
border: false,
autoScroll: true,
layout: 'fit',
autoWidth: true,
id: 'appArea'
}
],
bbar: {
xtype: 'toolbar',
ref: '../appStatusBar',
id: 'appStatusBar',
items: [
{
xtype: 'tbtext',
text: 'Pronto',
width: 355,
height: 22,
itemId: 'statusText',
ref: '../../statusText'
},
{
xtype: 'tbseparator'
},
{
xtype: 'tbtext',
text: 'Author:',
itemId: 'author',
ref: '../../author'
}
]
}
},
{
xtype: 'winCambioPassword'
},
{
xtype: 'winElencoUtenti'
},
{
xtype: 'winNuovoUtente'
}
];
applicationUi.superclass.initComponent.call(this);
}
});


and this is my code



/*
* File: application.js
* Date: Sun Oct 10 2010 10:31:45 GMT+0200 (CEST)
*
* This file was generated by Ext Designer version xds-1.0.2.14.
* http://www.extjs.com/products/designer/
*
* This file will be generated the first time you export.
*
* You should implement event handling and custom methods in this
* class.
*/

application = Ext.extend(applicationUi, {
initComponent: function() {
application.superclass.initComponent.call(this);
this.menuElencoUtenti.on('click', this.menuElencoUtentiClick, this);
this.menuNuovoUtente.on('click', this.menuNuovoUtenteClick, this);
this.menuCambiaPassword.on('click', this.menuCambiaPasswordClick, this);
this.menuLogout.on('click', this.menuLogoutClick, this);
},

menuElencoUtentiClick: function(){
var win = new winElencoUtenti({
renderTo: Ext.get('appArea')
});
win.show();
},

menuNuovoUtenteClick: function(){
var win = new winNuovoUtente({
renderTo: Ext.get('appArea')
});
win.show();
},

menuCambiaPasswordClick: function(){
var win = new winCambioPassword({
renderTo: Ext.getBody()
});
win.show();
},

menuLogoutClick: function(){
////faccio il logout
Ext.Msg.show({
title:'Logout?',
msg: 'Vuoi davvero uscire dall\'applicazione?',
buttons: Ext.Msg.YESNO,
fn: function(btn){
if(btn == 'yes')
{
location.href = "logout.php";
}
},
icon: Ext.MessageBox.QUESTION
});
}
});


with Ext 3.2.2 this work, but with Ext 3.3 i get this error


this.menuElencoUtenti is undefined
chrome://firebug/content/blank.gif this.menuElencoUtenti.on('click', this.menuElencoUtentiClick, this);


other application have same error like reference non found etc.

Bye

jarrednicholls
12 Oct 2010, 1:19 PM
Did you by chance override the Ext.Button class per these instructions (http://www.sencha.com/forum/showthread.php?99895-MenuItem-autoRef&p=470296#post470296) with your 3.2.2, but did not do so in Ext 3.3? refs do not work for buttons inside of a menu that's attached to another button, in any version of the framework. If you didn't include an override for Ext.Button, you will receive the error you mentioned.

bozzoz
12 Oct 2010, 11:01 PM
:D :D :D I'm very very stupid!!! When I have replaced the Ext 3.2 folder's with Ext 3.3 folder's I lost my ext_override.js file that was inside the Ext 3.2 folder's!

Thanks

jarrednicholls
13 Oct 2010, 6:27 AM
You're welcome! I hope you can recover your overrides file!

bozzoz
13 Oct 2010, 6:51 AM
Yes no problems, time machines! Now all my apps work with Ext 3.3!
Thank you again

One question! When the Designer will have the new components of Ext 3.3?