I notice that there's no setter for 'title' in a tab - but I need to update it dynamically with a number indicating a count. I tried the following code but the display does not change:
... how do I get the change in title value to be visible?
How to dynamically update a tab title
Code:
viewModel.bind('{numReservations}', function(val) { var newTitle = 'Reservations (' + val + ')';
var tabpanels = Ext.ComponentQuery.query('#regionCenter');
if(tabpanels.length) {
var tabpanel = tabpanels[0];
var tab = tabpanel.child('#tabreservations');
tab.title = newTitle; // The value does change here, but the display does not
tabpanel.updateLayout(); // Tried this but nothing changes
}
});
... how do I get the change in title value to be visible?
Thanks,
Neil
How to dynamically update a tab title
Aucun commentaire:
Enregistrer un commentaire