dimanche 1 mars 2015

How to dynamically update a tab title

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:

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