Dynamically adding an item to a toolbar in sencha touch
i have a toolbar which is set up like so:
MyApp.Guide.channelbar = new Ext.Toolbar({
items: [
{
text: 'loading...',
ui: 'plain',
disabled: true
}
]
});
It displays on the screen as expected, and looks just fine. So later on, i make a JSONP request and in the callback, i try to remove the loading item and insert a segmented button like so:
MyApp.Guide.channelbar.items.add(
new Ext.SegmentedButton({
name: 'testseg',
items: [{text:'test a'},{text:'test b'}]
}));
Now i'm certain that callback开发者_StackOverflow社区 is getting called, because in chrome's console i do the following to confirm that the item has been added:
MyApp.Guide.channelbar.items.items[1].name
But it just doesn't get updated on the screen. What am i missing?
are you calling doLayout after adding the item?
try using the your-classthe update method of the tab panel
,this will help you out
easily
精彩评论