【问题标题】:How to disable border line of Ext JS panel and Toolbar?如何禁用 Ext JS 面板和工具栏的边框线?
【发布时间】:2018-07-16 05:35:45
【问题描述】:

我试图隐藏边界线,但不能成功!这是提到的边界线的screenshot

您会注意到'Export Excel'radiofield 之间出现了一条垂直线。您将在下面找到一些包含这些元素的代码 sn-ps。我使用Toolbarpanel 来创建这些项目。所以尝试了几个配置,例如border: falseframe: falsebodyBorder: false,每个类都没有成功隐藏这一行。

感谢您的建议。

return [
            {
                xtype: 'panel',
                scrollable: true,
                // border: false,
                // bodyBorder: false,
                // frame: false,
                layout: {type: 'hbox', align: 'middle', pack: 'start'},
                items: [
                    {
                        xtype: 'panel',
                        // border: false,
                        // bodyBorder: false,
                        items: me.listToolbar() //This is end of 'toolbar' class.
                    },
                    {
                        xtype: 'panel',
                        items: me.subModuleTb() //'radiofield' starts by here
                    }
                ]
            }
        ];

这是一个叫做 ListToolbar 的类:

Ext.define('MyApp.ListToolbar', {
    extend: 'Ext.toolbar.Toolbar',
    alias: 'widget.listtoolbar',

    requires: [],

    dock: 'top',
    //border: 0, //This is not disappear the line as well
    //cls: 'list-toolbar //Defined 'border' as zero on all.scss for this cls but did not worked as well!
    layout: {
        type: 'table',
        tdAttrs: { style: 'padding: 5px 10px;' }
    },
    defaults: {
        enableToggle: true
    },
    scope:this,
    items: [

【问题讨论】:

    标签: javascript extjs border panel toolbar


    【解决方案1】:

    您使用的是什么版本?我希望这个边框出现在工具栏中。 您可以使用工具栏中的“border”:0 属性。或者您可以通过添加“Cls”属性在 CSS 中进行控制。

    Ext.create('Ext.toolbar.Toolbar', {
    renderTo: document.body,
    **border:0,**
    width   : 500,
    items: [
        {
            // xtype: 'button', // default for Toolbars
            text: 'Button'
        },
        {
            xtype: 'splitbutton',
            text : 'Split Button'
        },
        // begin using the right-justified button container
        '->', // same as { xtype: 'tbfill' }
        {
            xtype    : 'textfield',
            name     : 'field1',
            emptyText: 'enter search term'
        },
        // add a vertical separator bar between toolbar items
        '-', // same as {xtype: 'tbseparator'} to create Ext.toolbar.Separator
        'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.toolbar.TextItem
        { xtype: 'tbspacer' },// same as ' ' to create Ext.toolbar.Spacer
        'text 2',
        { xtype: 'tbspacer', width: 50 }, // add a 50px space
        'text 3'
    });
    

    【讨论】:

    • 亲爱的@fekkyDevunfortunately border 配置效果不佳!
    • 好吧,我已经给了cls: list-toolbar 并在all.scss 上调整了这些css,但这也没有帮助:.list-toolbar .x-toolbar, .list-toolbar .x-toolbar-default, .list-toolbar .x-table-layout-ct, .list-toolbar { border: none; box-shadow: none; background: none; }
    • @NuriEngin 感谢您的投票
    • 好的!它现在适用于.list-toolbar {border-style: none;}。我已经定义了cls 并通过主all.scss 对其进行样式设置,但在那里没有工作,因此将样式移至classic 文件夹下的Application.scss。为什么 main/global scss 没有效果?有什么想法吗?
    • 是否已经使用 sencha CMD 构建了您的应用程序?确保您在 app.json 中配置了正确的 scss 文件。如需进一步参考,您可以查看此docs.sencha.com/cmd/guides/app_json.html。希望这有助于理解。
    猜你喜欢
    • 1970-01-01
    • 2013-09-23
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 2012-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多