PDA

View Full Version : problem with panel update since 0.92



robertj98
28 Jul 2010, 12:54 AM
I have an ap that calls a detail card from a list component. The detail card just displays an image and text from the data in the selected list layout. In 0.91 I changed the update method to pass a record of data across instead of specifying individual data elements. Since putting 0.92 libraries in this does not seem to work and the data does not seem to get passed through to the detail card. Code is

Detail card update code:


item_detail.update(wrec);
Ext.getCmp('item_detail_toolbar').setTitle (wrec.get('stdesc'));
main.setCard('item_detail');


I can display the data values in wrec fine here just before the update call.


Detail card:


var item_detail = new Ext.Panel({
id: 'item_detail',
tpl: itemdetailTemplate,
dockedItems: [{
dock: 'top',
xtype: 'toolbar',
id: 'item_detail_toolbar',
items: [{
text: 'Back',
ui: 'back',
handler: function(){
if (gobackto) {
//alert ('going back to ' + gobackto);
main.setCard(gobackto);
Ext.getCmp('itemsearch').clearSelections();
} else {
main.setCard('items');
}
}
}]
}],
scroll: 'both'

});



Detail template


var itemdetailTemplate = new Ext.XTemplate(
'<tpl for=".">',
'<div class="itemdetail">',
'<h2>{stdesc}</h2>',
'<img src="http://www.collectgbstamps.co.uk/{stimagedir}{stimage}">',
'<p>',
'<br />{stdetails}{stmoredetails}',
'</p>',
'</div>',
'</tpl>'
);



TIA

evant
28 Jul 2010, 2:06 AM
Please post some working code. Also, use the debugger to step through the code, it should give you some hints.

robertj98
28 Jul 2010, 10:54 AM
Hi,

I tried the above code using Sencha 0.9.1 and 0.9.2 and using the debugger in Chrome (a first time so that was good practice).
Passing the record through to the update function works in 0.9.1 but not in 0.9.2


item_detail.update(wrec);

works in 0.9.1 - but in 0.9.2 no data from the record gets through to the template. It is getting into the update function though.


item_detail.update({
stdesc: wrec.get('stdesc'),
stimagedir: wrec.get('stimagedir'),
stimage: wrec.get('stimage'),
stdetails: wrec.get('stdetails'),
stmoredetails: wrec.get('stmoredetails')
});

works in both 0.9.1. and 0.9.2

Robert