PDA

View Full Version : [2.0-rc1] sub layout not working with Ie6



dxd
25 Nov 2007, 7:17 AM
Hi,

I've create a 2 level border layout like this :
- BorderLayout
- North : logo
- Center: BorderLayout
- West : TreePanel
- Center: nothing

So my problem is with FireFox, it's perfect while with IE6, I have an error :
"events" is null or is not and object(line 13973)(ext-all-debug.js)

here are the code :
[CODE]
Ext.apply( Tine.ExtCms.BaseApp, {

createLangTree: function() {
var treeId = 'tree-lang';
var baseTools = [
{
id:'refresh',
handler: function(){
var tree = Ext.getCmp( treeId );
tree.body.mask('Loading', 'x-mask-loading');
tree.root.reload();
tree.root.collapse(true, false);
setTimeout(function(){ // mimic a server call
tree.body.unmask();
tree.root.expand(true, true);
}, 1000);
}
}
];
var toolbar = [
{ cls: 'x-btn-text-icon icon-add',
text: 'Ajouter',
id: 'lang-add-bt',
handler: function() {
var elm = Ext.getCmp('lang-add-form');
elm.form.reset();
elm.show(true);
this.setDisabled( true );
}
}
];
var buttons = [
{ text: 'Annuler',
handler: function() {
var elm = Ext.getCmp('lang-add-form');
elm.form.reset();
elm.hide(true);
Ext.getCmp('lang-add-bt').setDisabled( false );
}
},
{ text: 'Sauver',
handler: function() {
var form = Ext.getCmp('lang-add-form').form;
if ( form.isValid() ) {
form.submit( { params : {
mode: 'langues',
op: 'create-new'
},
waitMsg: 'Saving...',
success: function() {
var tree = Ext.getCmp( treeId );
tree.body.mask('Loading', 'x-mask-loading');
tree.loaded = false;
tree.root.reload();
tree.root.collapse(true, false);
setTimeout(function(){ // mimic a server call
tree.body.unmask();
tree.root.expand(true, true);
}, 1000);
Ext.getCmp('lang-add-form').hide( true );
},
failure: function() {
Ext.MessageBox.show( {
msg: "L'enregistrement a

dxd
25 Nov 2007, 7:26 AM
Hum ... It's a false alarm ...

In fact, It's very confusing from IE and from FireFox as well
in my code above :


items: [
{ region: 'west',
id: 'menu',
width: 200,
minSize: 200,
maxSize: 350,
header: false,
collapsible: false,
split: true,
margins: '0 0 0 0',
border: false,
baseCls: '',
layoutConfig:{
animate:true
},
items: [
// ITEMS
this.createCategoriesTree(),
this.createLangTree()
// ITEMS
]
},
{ region: 'center',
id: 'main',
header: false,
collapsible: false,
split: true,
margins: '0 0 0 0'
},
]


I've simply have a syntax mistake with the colons after my center region ...
But in fact, FireFox is a bit too nice and he accept this syntax error.
With IE, it report me a events object errors .. damn crazy things ...

alamandrax
25 Nov 2007, 8:03 AM
This happens even if you were using Opera or Safari to test your code, fyi. More information is here http://extjs.com/learn/Ext_FAQ#My_code_does_not_work_in_Internet_Explorer.2C_but_it_works_fine_in_Firefox

dxd
25 Nov 2007, 8:11 AM
Yeah I know the link :) But you can be carefull as you want but when you're in the rush or something like that, you'll surely make some mistakes like this ...
The shame is that js interpreter should be more strict about this ...

alamandrax
25 Nov 2007, 9:57 AM
Have you tried using the Aptana IDE? It immediately shows trailing/missing commas in JavaScript as errors.

I experience a lot of memory leaks when running Aptana though, so don't use it very regularly (I stick to notepad2), but you could give it a shot. Quite worth it.