PDA

View Full Version : Problem Toolbar



myput
26 Oct 2011, 7:50 AM
Hello, i have a problem in a penel calling 2 panels in items.
I have no panel in the main panel.
In the first panel, i have a dockedItem toolbar with a searchfield. I display a list in the panel under the toolbar.
When i click on an item of the list, it's calling the main view with setActiveItem and calling then the detailPanel.
I have a toolbar in this panel with a back button who do setActiveItem, to the list....

Then it's normal for the moment, but, in my detailPanel, i have some buttons calling different view. I have in each view a toolbar with a back button.
The problem is, when i click on the back button of a panel OR i click on a button, the searchfield toolbar appears before the real toolbar appears ....

:D:D

This is my code for understand:
The main View:


WPApp.views.SearchPanel = Ext.extend(Ext.Panel,{
title: WPApp.config._SearchTitle,
iconCls: WPApp.config._SearchIconCls,
fullscreen: true,
layout: 'card',
items: [WPApp.views.SearchPanelWithToolbar, WPApp.views.ResultPanelDetail],
initComponent: function() {
Ext.apply(WPApp.views, {
SearchPanelWithToolbar: new WPApp.views.SearchPanelWithToolbar(),
ResultPanelDetail: new WPApp.views.ResultPanelDetail(),
DescriptionButton: new WPApp.views.DescriptionButton(),
});
this.items = [
WPApp.views.SearchPanelWithToolbar,
WPApp.views.ResultPanelDetail,
WPApp.views.DescriptionButton,
];
WPApp.views.SearchPanel.superclass.initComponent.call(this);
this.doComponentLayout();
}
});


The list view:



WPApp.views.ResultPanelList = new Ext.List ({
fullscreen: true,
scroll: 'vertical',
itemTpl: loadURL(WPApp.config.host + WPApp.config.SearchTPL + 'SearchDirectoryListPanel.html'),
store: WPApp.stores.ResultPanelListStore,
listeners: {
itemtap: function(view, index) {
var record = WPApp.stores.ResultPanelListStore.getAt(index);
WPApp.views.DescriptionButton.update(record.data.urlDescriptionPage);
WPApp.views.SearchPanel.setActiveItem(WPApp.views.ResultPanelDetail, {animation: {type:'flip'}});
}
}
});


WPApp.views.SearchPanelWithToolbar = Ext.extend(Ext.Panel,{
dockedItems: [WPApp.views.SearchPanelToolbar],
fullscreen: true,
layout: "card",
items: [WPApp.views.ResultPanelList],
});


and the detailView:



WPApp.views.ResultPanelDetailToolbar = new Ext.Toolbar ({
title: ' ',
items: [{
text: 'retour',
ui: 'back',
handler: function() {
WPApp.views.SearchPanel.setActiveItem(WPApp.views.SearchPanelWithToolbar, {type:'slide', direction:'right'});
}
}]
});

WPApp.views.ResultPanelDetail = Ext.extend(Ext.Panel,{
fullscreen: true,
dockedItems: [WPApp.views.ResultPanelDetailToolbar],
items: [
{
defaults: {
xtype: 'button',
ui: 'round',
margin: 15,
flex: 1
},
items: [
{
text: 'Decription',
handler: function() {
WPApp.views.SearchPanel.setActiveItem(WPApp.views.DescriptionButton, {type:'slide', direction:'right'});
}
},
]
},
]
});


The view of detail is a normal panel ...



Sorry for all this code, it's for really understand where is the problem ...

Have you an idea please?