Results 1 to 3 of 3

Thread: Populate a TitleBar using a store

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Vote Rating

    Default Answered: Populate a TitleBar using a store

    Hi, I need to create a TitleBar which is sucked into a set of screens. The TitleBar elements are drop-down lists. The items within the drop-down lists must be dynamic and must be loaded from a data file.

    I've managed to load the data but I cannot pass the data back to the TitleBar. In other words, I need somehow to create a reference to the titlebar. I've marked in red the code that fails.

    Ext.define('CustomerToolbar', {
        extend: 'Ext.TitleBar',
        xtype: 'customer-toolbar',
        initialize: function() {
  "end of init");       
        config: {
            layout: 'hbox',
            defaults: {
        loadItems: function (titleBar) {
            var itemList = [];
            var itemOptionList = [];
            Ext.getStore('OrganizationStore').load(function(organizationList) {
      "getOptionList inside the store load function");
                Ext.each(organizationList, function(organization) {
          "organizations: " + organization.get("name") + "," + organization.get("id"));
                    itemOptionList.push({text: organization.get("name"), value: organization.get("id")});
      "itemList - about to populate");
                        xtype: 'selectfield',
                        name: 'customerOptions',
                        id :'organizationId',
                        options: itemOptionList,
                        action :'selectOrganizationAction'
      "itemList - populated");
      "itemList within the store block: " + itemList);
      "this: " + this);
      //THIS IS WHERE I AM HAVING THE PROBLEM. The variable this points to the store and not to the TitleBar
  "itemList outside the store block: " + itemList);
    Many Thanks,

  2. Why not just use the store on the selectfield?!/...lect-cfg-store

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts