You can create menu items dynamically by calling createComponents()
. I've put together a fiddle for you that dynamically adds components to a menu. Note that if you want to clear out old items you'll need to call destroy()
on each item that isn't the scroller for the menu.
See this fiddle: