PDA

View Full Version : List and detailPanel Problem



myput
3 Nov 2011, 3:01 AM
Hello,

I have a problem with a list data from store, correspond with a view. I can give data from the list store to my panel and use this. I use for create a map with longitude and latitude data.

I have my list, i open a panel who contain some buttons, and there is a map button. In this button, i open a new panel with the map.
I send data to my list itemtap to my map panel, but call the view only in my detail card panel, who contain the buttons.

But the map panel is called just when i do the function itemTap... I don't understand how to give the data to my detailCard panel, and after give the data to my mapPanel ...

List:


itemtap: function(view, index) {
var record = WPApp.stores.ResultPanelListStore.getAt(index);
Ext.dispatch({
controller: WPApp.controllers.searchController,
action: 'tapDetailView',
data: record.data
});
}


Controller:



tapDetailView: function (record) {
var data = record.data;
WPApp.views.ResultPanelDetailToolbar.setTitle(data.name);
WPApp.views.CarteButton.initMap(data);
WPApp.views.SearchPanelToolbar.hide();
WPApp.views.SearchPanel.setActiveItem(WPApp.views.ResultPanelDetail, {animation: {type:'slide', direction:'right'}});
},


and the map Panel:



WPApp.views.CarteButton = Ext.extend(Ext.Panel,{
dockedItems: [WPApp.views.CarteButtonToolbar],
layout: 'fit',
initMap: function(data) {
var pos = new google.maps.LatLng(data.latitude, data.longitude);
var desc = '<div class=\'WPAppMapInfoWindow\'>' + data.markerTitle + '<br/>' + data.markerDescription + '</div>';
var isRefreshRequired = false;
if (this.getComponent(0).getXTypes() === 'box/map') {
this.remove(this.getComponent(0));
isRefreshRequired = true;
}
var map = new Ext.Map ({
fullscreen: true,
title: data.name,
markerDesc: desc,
markerPos: pos,
});
this.add(map);
if(isRefreshRequired) this.doLayout();
}
});


The code of detailpanel is just a call of my mapPanel in a button....
It seems the mapPanel take the place of the detailPanel ...
But i don't know how to fix it
Can you help me?

myput
4 Nov 2011, 8:37 AM
up