EXTJS 6.2.1 类似于 CheckboxGroup 的项目符号组

问题描述 投票:0回答:1

有人知道是否有一个 EXTJS 控件可以生成类似于复选框组的项目符号组吗?

extjs extjs6.2
1个回答
0
投票

如果您想要项目符号列表外观,您可以使用 CSS 自定义复选框组样式,如下例所示

Ext.application({
    name: 'BulletListExample',
    launch: function () {
        Ext.create('Ext.form.Panel', {
            title: 'Bullet List Example',
            width: 300,
            renderTo: Ext.getBody(),
            items: [{
                xtype: 'checkboxgroup',
                columns: 1,
                cls: 'bullet-list', // Apply custom CSS class
                items: [{
                        boxLabel: 'Item 1',
                        name: 'item1'
                    }, {
                        boxLabel: 'Item 2',
                        name: 'item2'
                    }, {
                        boxLabel: 'Item 3',
                        name: 'item3'
                    },
                    // Add more items as needed
                ]
            }]
        });
    }
});

CSS:

.x-form-checkbox-default:before {
    content: '\2022';
}

.x-form-cb-checked .x-form-checkbox-default:before {
    content: '\2022';
}
© www.soinside.com 2019 - 2024. All rights reserved.