1. #1
    Sencha User
    Join Date
    Jun 2008
    Posts
    11
    Answers
    1
    Vote Rating
    0
    aceman3000 is on a distinguished road

      0  

    Default Unanswered: Combination of tabPanel and nestedList = Double Toolbar

    Unanswered: 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
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      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
    aceman3000 is on a distinguished road

      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
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      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.

Thread Participants: 1

Tags for this Thread