Results 1 to 4 of 4

Thread: Combination of tabPanel and nestedList = Double Toolbar

  1. #1
    Sencha User
    Join Date
    Jun 2008
    Posts
    11
    Answers
    1
    Vote Rating
    0
      0  

    Default Combination of tabPanel and nestedList = Double Toolbar

    I have my main view which is a tabPanel with 3 items. When i click on "Service" a nestedList is loaded, but i have two toolbars now. How do i remove one of them?
    toolbar.png
    Here is my code:

    Main.js
    Code:
    Ext.define('caravan.view.Main', {    extend: 'Ext.tab.Panel',
        xtype: 'mainpanel',
        requires: [
            // 'caravan.view.FahrzeugeList',
            // 'caravan.view.FahrzeugDetail',
            'caravan.view.FahrzeugePanel',
            'caravan.view.Service'
        ],
    
    
        config: {
            fullscreen: true,
            tabBarPosition: 'bottom',
            items: [
            {
                title: 'Home',
                html: 'Test',
                iconCls: 'home',
            },
            {
                title: 'Fahrzeuge',
                xtype: 'fahrzeugepanel',
                iconCls: 'star'
            },
            {
                title: 'Service',
                itemCls: 'config',
                xtype: 'service'
            }
            ]
        }
    });
    Service.js
    Code:
    Ext.define('caravan.view.Service', {    extend: 'Ext.dataview.NestedList',
        xtype: 'service',
        
        requires: [
            'caravan.store.Service'
        ],
        config: {
            items: [
            {
               xtype: 'nestedlist',
               iconCls: 'star',
                cls: 'blog',
                displayField: 'title',
    
    
                store: 
                {
                    type: 'tree',
    
    
                    fields: [
                        'title', 'link', 'author', 'contentSnippet', 'content',
                        {name: 'leaf', defaultValue: true}
                    ],
    
    
                    root: {
                        leaf: false
                    },
    
    
                    proxy: {
                        type: 'jsonp',
                        url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog',
                        reader: {
                            type: 'json',
                            rootProperty: 'responseData.feed.entries'
                        }
                    }
                },
    
    
    
    
                detailCard: {
                    xtype: 'panel',
                    scrollable: true,
                    styleHtmlContent: true
                },
    
    
                listeners: {
                    itemtap: function(nestedList, list, index, element, post) {
                        this.getDetailCard().setHtml(post.get('content'));
                    }
                }
            }
            ],
        }
    });
    I tried to remove title from Main.js for the xtype: "Service" but then i get the error:
    Code:
    Adding a card to a tab container without specifying any tab configuration
    What do i need to do?

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Can you query the items from the 'service' and remove it or hide it that way?

  3. #3
    Sencha User
    Join Date
    Jun 2008
    Posts
    11
    Answers
    1
    Vote Rating
    0
      0  

    Default

    What you mean by that? Entries are getting displayed and i can click them and get to the detail page.

  4. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    When the Services page is created, it fires an initialize function. You can listen for that function and do this to remove the toolbar
    Code:
    Ext.ComponentQuery.query('toolbar > [title="Services"]')[0].parent.destroy();
    It's a bit primitive but it worked for me.

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
  •