Dynamic toolbar is implemented at the base of Dynamic Menu Button, I have before recursion method to create first level buttons. The buttons has ‘dynamicItem’ mark to remove them after store’s data chane. If you are going to implement some static components in the toolbar you must think about appropriate mechanism to keep the order.

Ext.define('app.ux.toolbar.Dynamic', {
    extend: 'Ext.toolbar.Toolbar',

    store: false,
    loadMessage: "Loading...",
    showTreeStoreLoading: true,

    initComponent: function () {
        this.initMenu();
        this.callParent();
    },

    initMenu: function () {
        this.getStore().on('beforeload', this.onStoreBeforeLoad, this);
        this.getStore().on('load', this.onStoreLoad, this);
        if (this.getStore().isLoaded()) {
            this.createDynamicItems();
        }
    },

    onStoreBeforeLoad: function () {
        this.removeDynamicItems();
        if (this.showTreeStoreLoading) {
            this.setLoading(this.loadMessage);
        }
    },

    onStoreLoad: function (store) {
        store.on('datachanged', this.onStoreDataChanged, this);
        this.createDynamicItems();
    },

    onStoreDataChanged: function () {
        this.createDynamicItems();
    },

    removeDynamicItems: function () {
        var dynamicItems = this.query('button[dynamicItem=true]');
        Ext.Array.each(dynamicItems, function (dynamicItem) {
            this.remove(dynamicItem);
        }, this);
        return this;
    },

    createDynamicItems: function () {
        this.setLoading(false);
        this.removeDynamicItems();
        var rootNode = this.getStore().getRoot();
        rootNode.eachChild(this.createToolbarButton, this);
    },

    createToolbarButton: function (record) {
        var button = Ext.create('Ext.button.Button', {
            text: record.get('text'),
            glyph: record.get('glyph'),
            record: record,
            dynamicItem: true,
            handler: this.menuItemHandler,
            scope: this
        });

        if (!record.isLeaf()) {
            var menu = Ext.create('Ext.menu.Menu');
            button.setMenu(menu);
            record.menu = menu;
            record.eachChild(this.createMenuItems, this);
        }
        this.add(button);
    },

    createMenuItems: function (record) {
        var menuItem = Ext.create('Ext.menu.Item', {
            text: record.get('text'),
            glyph: record.get('glyph'),
            record: record,
            handler: this.menuItemHandler,
            scope: this
        });
        if (record.isLeaf()) {
            record.parentNode.menu.add(menuItem);
        } else {
            var menu = Ext.create('Ext.menu.Menu');
                menuItem.setMenu(menu);
            record.menu = menu;
            record.item = menuItem;
            record.parentNode.menu.add(menuItem);
            record.eachChild(this.createMenuItems, this);
        }
    },

    getStore: function () {
        if (this.store.isStore) {
            return this.store;
        } else {
            return Ext.StoreManager.lookup(this.store);
        }
    },

    menuItemHandler: function(menuItem) {
        this.fireEvent('menuItemSelect', this, menuItem.record);
    }
});