简体   繁体   中英

ExtJs Toolbar config object

So i have the following scenario in my main view i have a container like this:

Ext.define('APP.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',
id: 'root',
requires: [
    'Ext.menu.*'
],
items:[
    'APP.view.main.topBar'
    ]
});

my APP.view.main.topBar looks like this:

Ext.define('APP.view.main.topBar',{

extend: 'Ext.container.Container',
docked: 'top',
xtype: 'toolbar',
id: 'topBar',
title: 'Meniu',

items:[
    {
        text: 'Furnizori',
        iconCls: 'x-fa fa-qrcode',
        menu: 'APP.view.main.menus.menuFurn'
        }

    ]
});

the problem is i get the following error:

Invalid config, must be a valid config object

i'm trying to include the toolbar in the items of the main

The item in the main class needs to be a proper object. See below:

Ext.define('APP.view.main.topBar', {

    extend: 'Ext.container.Container',
    docked: 'top',
    xtype: 'myAppTopBar',
    id: 'topBar',
    title: 'Meniu',

    items: [{
            text: 'Furnizori',
            iconCls: 'x-fa fa-qrcode',
            menu: 'APP.view.main.menus.menuFurn'
        }

    ]
});

Ext.define('APP.view.main.Main', {
    extend: 'Ext.container.Container',
    xtype: 'app-main',
    id: 'root',
    requires: [
        'Ext.menu.*'
    ],
    items: [{
        xtype: 'myAppTopBar'
    }]
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM