1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    172
    Vote Rating
    1
    Dmoney is on a distinguished road

      0  

    Default dynamically add items to Lbar

    dynamically add items to Lbar


    How can I add items to an lbar from an external json file?

    with a menu I can do this:

    Code:
     initComponent: function() {
    
    
        Ext.Ajax.request({
          url: '../shared/jsonMenu.php',
          success: this.onMenuLoad,
          scope: this
        });
        this.callParent(arguments);
      },
    
    
      onMenuLoad: function(response, options) {
        var json = Ext.decode(response.responseText);
        this.add(json.menu);
      }
    but I can't make that work with an lbar. any suggestions?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,939
    Vote Rating
    635
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Exactly the same thing. lbar is just a toolbar, it extends container, the same way menu does.

    You may also want to look at the ComponentLoader class.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1

Tags for this Thread