thomas12
3 Dec 2010, 7:31 AM
Hi,
I want to create a application based on a card layout. So I created a panel and added some items to it. With panel.setActiveItem, I could switch between the different items. This all worked fine.
Than I started over, using the twitter application as example and also created an ext.Application just like the twitter example.
Now I encounter a strange problem in the viewport.js.
If I want to add items to the panel (via the initComponent function), this does not work. If I change the items to be dockedItems, everything works fine.
But I need items instead of dockedItems, because I do not want to show them all at once, but one per card.
This code works fine (but shows all docked items at once). If I change the first occurance of dockedItems to items, the code does not work anymore. I just used the same code that worked fine with items when I just used the onReady function of ext.setup. (this was the way I did it before I followed the twitter application example)
sim.Viewport = Ext.extend(Ext.Panel, {
id : 'viewport',
layout : 'card',
fullscreen : true,
cardSwitchAnimation : 'cube',
initComponent : function() {
Ext.apply(this, {
activeItem : 0,
dockedItems : [ {
dockedItems : [ {
dock : 'top',
xtype : 'toolbar',
title : 'SIM Main Menue'
}, {
dock : 'top',
xtype : 'selectionView'
} ]
}, {
dockedItems : [ {
dock : 'top',
xtype : 'customerView'
} ]
}
]
});
sim.Viewport.superclass.initComponent.apply(this, arguments);
}
});
can you help me and explain why the dockedItems work here and the items do not?
Thanks and regards
Thomas
I want to create a application based on a card layout. So I created a panel and added some items to it. With panel.setActiveItem, I could switch between the different items. This all worked fine.
Than I started over, using the twitter application as example and also created an ext.Application just like the twitter example.
Now I encounter a strange problem in the viewport.js.
If I want to add items to the panel (via the initComponent function), this does not work. If I change the items to be dockedItems, everything works fine.
But I need items instead of dockedItems, because I do not want to show them all at once, but one per card.
This code works fine (but shows all docked items at once). If I change the first occurance of dockedItems to items, the code does not work anymore. I just used the same code that worked fine with items when I just used the onReady function of ext.setup. (this was the way I did it before I followed the twitter application example)
sim.Viewport = Ext.extend(Ext.Panel, {
id : 'viewport',
layout : 'card',
fullscreen : true,
cardSwitchAnimation : 'cube',
initComponent : function() {
Ext.apply(this, {
activeItem : 0,
dockedItems : [ {
dockedItems : [ {
dock : 'top',
xtype : 'toolbar',
title : 'SIM Main Menue'
}, {
dock : 'top',
xtype : 'selectionView'
} ]
}, {
dockedItems : [ {
dock : 'top',
xtype : 'customerView'
} ]
}
]
});
sim.Viewport.superclass.initComponent.apply(this, arguments);
}
});
can you help me and explain why the dockedItems work here and the items do not?
Thanks and regards
Thomas