PDA

View Full Version : Problems with redrawing panel in a detailpage



appagenturbw
27 Jun 2011, 12:31 AM
I have a detail page in a mvc-app. For testing purpose i add/change some items and changing the title of the toolbar. In the console output are the correct new items ("mytest 1", "test 2", "test 3"), but the panel is not redrawing ("test 1", "test 2").

But the toolbar in the dockedItems variable shows the correct new title = record.get('city') and the new item ("test").

How can i redraw/update the items in the panel?



app.views.detailPage = Ext.extend(Ext.Panel, {
dockedItems: [{
xtype: 'toolbar',
title: 'Detailpage',
defaults: {
ui: 'plain',
iconMask: true
},
items: [
{
text: 'zurück',
ui: 'back',
listeners: {
'tap': function () {
Ext.dispatch({
controller: app.controllers.listPage,
action: 'index',
animation: {type:'slide', direction:'right'}
});
}
}
}
]
}],
styleHtmlContent:true,
scroll: 'vertical',
items: [
{html: 'test 1'},
{html: 'test 2'}
],

updateWithRecord: function(record){

this.add({html: 'test 2'});

var first = this.getComponent(0);
first.update('mytest 1');
this.doLayout();
console.log(this.items.items);

var toolbar = this.getDockedItems()[0];
toolbar.setTitle(record.get('city'));
toolbar.add({html: 'test'});
}
});


Ext.reg('app.views.detailPage', app.views.detailPage);