PDA

View Full Version : Update a docked Item html by controller



Sara31
26 Dec 2011, 10:26 PM
Hi,

I want to update html of a docked item, but getting error: Uncaught TypeError: Cannot call method 'getWidth' of null

controller code:


....
if (!this.todoView) {
this.todoView = this.render( {
xtype : 'todolist'
});
}
var mainPanel = this.application.viewport.query('#mainCardPan')[0];
mainPanel.setActiveItem(this.todoView);
var dItem = this.todoView.query('#plannedDockedItem')[0].dockedItems.items[0];
dItem.update("hello");
......


and the view code


....
items: [
{
flex:2,
layout:'fit',
itemId: 'plannedDockedItem',
items:[{
xtype: 'plannedTodoList'
}],
dockedItems: [{
xtype: 'toolbar',
dock:'top',
html: '<div style = "color: white;"><b>Planned without a Time:</b> ' + 20 + ' items</div>'
}]
.....
.....


update is an Ext.Element function, i m not getting why its giving this error, any suggestion?

mitchellsimoens
27 Dec 2011, 6:36 AM
update is not just an Ext.Element method... any subclass of Ext.Component has an update method. Instead of using update(), I would add/remove a component to the Toolbar.

Sara31
27 Dec 2011, 9:42 PM
right,
thanks