1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| var azer = 0;
accordeon = Ext.extend(Ext.Panel, {
title: 'mon titre',
layout: 'fit',
border: false,
collapsed: true,
initComponent: function() {
this.items = new Array();
this.listeners = {
expand: function(obj) {
var urlNode = obj.items.items[0].root.childNodes[0].url;
Ext.getCmp('layoutCenter').layout.setActiveItem('Grid');
GridStore.load(
{
params: {
task: 'folder',
id: appStore.getAt(0).get('id'),
lib: appStore.getAt(0).get('lib'),
type: appStore.getAt(0).get('type'),
dossier: appStore.getAt(0).get('dossier'),
urlNode: urlNode
}
}
);
Ext.getCmp('layoutCenter').items.get(0).removeAll();
Ext.getCmp('layoutCenter').items.get(0).add(new Grid());
Ext.getCmp('layoutCenter').items.get(0).setTitle(obj.title);
Ext.getCmp('layoutCenter').doLayout({force: true});
azer = 1;
},
beforeCollapse: function(obj) {
if(azer == 1)
{
// console.info(obj);
if(!confirm('Voulez vous vraiment quitter ?'))
{
obj.collapse();
}
}
}
}
accordeon.superclass.initComponent.call(this);
}
}); |
Partager