PDA

View Full Version : DetailCard in nestedlist open only one time



myput
10 Oct 2011, 8:00 AM
Hello,

I have a problem in my nestedList, after saw some solution on the forum, my code still don't work.
I'm trying to display a list in the detailCard of a nestedList.
I can display the list, juste one time, when i come back to my nestedList, by back button, nothing working again, i can't push the item, the same as if i don't have getDetailCard function ....

This is my code:
In my NestedList File:


getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data;
parentData = parent.attributes.record.data;
detailCard = new Ext.Panel ({
initComponent: function() {
Ext.apply(WPApp.views, {
DirectoryItemListContainer: new WPApp.views.DirectoryItemListContainer()
});
this.items = [
WPApp.views.DirectoryItemListContainer
];
WPApp.views.DirectoryNestedListPanel.initComponent.call(this);
this.doComponentLayout();
}
});
detailCard.update(itemData);
this.backButton.setText(parentData.text);
this.title = itemData.text;
return detailCard;
},


And in my ItemList Container:


WPApp.views.DirectoryItemListList = new Ext.List({
fullscreen: true,
itemTpl : '{firstName} {lastName}',
store: WPApp.stores.DirectoryItemListListStore
});


WPApp.views.DirectoryItemListContainer = Ext.extend(Ext.Panel,{
id: 'WPApp.views.DirectoryItemListContainer',
items: [WPApp.views.DirectoryItemListList]
});


I don't know if there is another better way for do that ...

Thanks for helping :)

myput
11 Oct 2011, 1:39 AM
I tried with:


getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data;
parentData = parent.attributes.record.data;
WPApp.views.DirectoryItemListContainer.update(itemData);
this.backButton.setText(itemData.text);
return WPApp.views.DirectoryItemListContainer;
},



WPApp.views.DirectoryItemListList = new Ext.List({
fullscreen: true,
itemTpl : '{firstName} {lastName}',
store: WPApp.stores.DirectoryItemListListStore
});


WPApp.views.DirectoryItemListContainer = new Ext.Panel ({
id: 'WPApp.views.DirectoryItemListContainer',
items: [WPApp.views.DirectoryItemListList],
listeners: {
beforeDestroy: function() {
return false;
}
}
});

But no sucess: i display just one time my list and after when i come back, the panel is empty ...

Someone can help me please?

mhagr
27 Nov 2011, 7:28 PM
I am having the same problem. Did any one find a solution?

myput
27 Nov 2011, 11:59 PM
try to do:



getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data;
parentData = parent.attributes.record.data;
var DetailPanel = new Ext.Panel({
recordNode: item,
layout: 'fit',
items: [App.views.DirectoryListContainer],
listeners: {
beforeDestroy: function() { return false; }
}
});
DetailPanel.update(itemData);
return DetailPanel;
},


hope this helps