如何在ExtJS版本7中向操作列中的项添加填充

y1aodyip  于 2022-10-18  发布在  其他
关注(0)|答案(1)|浏览(158)

我有一个使用可点击图标的动作栏目,来自Font Awesom。我唯一的问题是图标太近了,填充配置不起作用。有谁有解决方案吗?

{
            header:'Actions',
            dataIndex: 'id', 
            xtype:'actioncolumn',     
            focusableContainer: true,       
            flex: 0.55,
            align: 'center',
            items: [{
                iconCls:'fas fa-pen',
                ariaLabel:'Edit Feedback',
                ariaLabelledBy:'Edit Feedback',
                tooltip: 'Edit',

                handler:'onEdit'
            },
            {
                id: Ext7.id() + '_delete',
                itemId: Ext7.id() + '_delete',
                ariaLabel:'Delete Feedback',
                ariaLabelledBy:'Delete Feedback',
                iconCls: 'fas fa-trash',        
                tooltip: 'Delete',
                handler: 'onDelete'
            }
            ]           
}
pokxtpni

pokxtpni1#

您可以添加自定义的CSS类。

.custom-padding {
    padding: 15px;
}

然后添加到您的物品中。

{
        xtype: 'actioncolumn',
        width: 70,
        items: [{
            iconCls: 'x-fa fa-cog custom-padding',
            tooltip: 'Edit',
            handler: function(grid, rowIndex, colIndex) {
                var rec = grid.getStore().getAt(rowIndex);
                alert("Edit " + rec.get('firstname'));
            }
        }, {
            iconCls: 'x-fa fa-times custom-padding',
            tooltip: 'Delete',
            handler: function(grid, rowIndex, colIndex) {
                var rec = grid.getStore().getAt(rowIndex);

                alert("Terminate " + rec.get('firstname'));
            }
        }]
    }

相关问题