PDA

View Full Version : Function to send variable to another Panel



rolfiee
24 Aug 2011, 2:32 PM
Hi there,

I really like this forum, this give me a lot of information.
But I can't find out why i do not get the this.firstName variable.
And the 'ListDemo.detailPanel.update(record.data);' does also not working properly
because when i press on 1 person, i get the textarea field, but when i press on the second person,
the textarea field is disappeared.

So which function do I need to send the data.firstName as variable to the ListDemo.detailPanel?



--cut--
ListDemo.detailPanel = new Ext.Panel({
id: 'detailpanel',
tpl: 'Hello, {firstName}!',
dockedItems:[ListDemo.detailToolbar],
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
flex: 4,
xtype: 'textareafield',
style: 'margin-right: 10px;',
id: 'textquery',
placeHolder: 'Hello'+ this.firstName
}]
});


ListDemo.listPanel = new Ext.List({
id: 'indexlist',
store: ListDemo.ListStore,
itemTpl: '<div class="contact">{firstName} {lastName}</div>',
grouped: true,


listeners : {
itemtap : function(dataview, index, item, e) {
var store = dataview.getStore(),
record = store.getAt(index);
var name = record.data.firstName + " " + record.data.lastName;
ListDemo.detailToolbar.setTitle(name);
ListDemo.detailPanel.update(record.data);
ListDemo.Viewport.setActiveItem('detailpanel');


}
}
});
--cut--

rolfiee
24 Aug 2011, 3:49 PM
So, i'm looking to pass the variable. Anyone has any idea ?