kimimsc
3 Dec 2011, 7:40 AM
Hi,
I am trying to build a basic ext4 application. When i put the whole code in the launch element of Ext.Application, everything is working fine.
But when i tried to put the code in viewport.js and to use the autoCreateViewport config, i've got a blank page.
Here is the code:
app.js
Ext.Loader.setConfig({
enabled:true
});
Ext.application({
name: 'EC',
appFolder: 'js_app',
autoCreateViewport: true
});
Viewport.js
Ext.define('EC.view.Viewport', {
extend: 'Ext.container.Viewport',
//requires: ['EC.view.AccordionNavigation'],
layout: 'border',
initComponent: function() {
Ext.apply(this, {
items: [{
region: 'north',
html: '',
autoHeight: true,
border: false
},{
region: 'west',
collapsible: true,
title: 'Navigation',
split: true,
width: 200,
xtype: 'panel',
layout: 'accordion',
items: [{
title: 'Panel 1',
html: 'Panel content!'
},{
title: 'Panel 2',
html: 'Panel content!'
},{
title: 'Panel 3',
html: 'Panel content!'
}]
},{
region: 'east',
title: 'East Panel',
collapsible: true,
split: true,
width: 200
},{
region: 'center',
xtype: 'tabpanel',
enableTabScroll:true,
activeTab: 0,
items: [{
title: 'Accueil',
iconCls: 'home'
},{
title: 'Tableau de bord',
iconCls: 'dashboard'
}]
}]
});
this.callParent();
}
});
Merci d'avance. ;)
I am trying to build a basic ext4 application. When i put the whole code in the launch element of Ext.Application, everything is working fine.
But when i tried to put the code in viewport.js and to use the autoCreateViewport config, i've got a blank page.
Here is the code:
app.js
Ext.Loader.setConfig({
enabled:true
});
Ext.application({
name: 'EC',
appFolder: 'js_app',
autoCreateViewport: true
});
Viewport.js
Ext.define('EC.view.Viewport', {
extend: 'Ext.container.Viewport',
//requires: ['EC.view.AccordionNavigation'],
layout: 'border',
initComponent: function() {
Ext.apply(this, {
items: [{
region: 'north',
html: '',
autoHeight: true,
border: false
},{
region: 'west',
collapsible: true,
title: 'Navigation',
split: true,
width: 200,
xtype: 'panel',
layout: 'accordion',
items: [{
title: 'Panel 1',
html: 'Panel content!'
},{
title: 'Panel 2',
html: 'Panel content!'
},{
title: 'Panel 3',
html: 'Panel content!'
}]
},{
region: 'east',
title: 'East Panel',
collapsible: true,
split: true,
width: 200
},{
region: 'center',
xtype: 'tabpanel',
enableTabScroll:true,
activeTab: 0,
items: [{
title: 'Accueil',
iconCls: 'home'
},{
title: 'Tableau de bord',
iconCls: 'dashboard'
}]
}]
});
this.callParent();
}
});
Merci d'avance. ;)