【问题标题】:Extjs align column item to the rightExtjs 将列项向右对齐
【发布时间】:2020-09-23 15:46:25
【问题描述】:

我在将项目向右对齐时遇到问题,或者无论如何在列的末尾。 如图所示:

即使右侧有空格,它也会将项目左侧对齐,覆盖部分文本(完整的文本是“电池电量”)。我想在向下箭头附近对齐它。 我尝试使用 align:'right' 没有成功。

我该如何解决?这是我的代码:

columns: {
        defaults: {
            flex: 1,
        },
        items: [{
             ....
        },{
            text: Strings.positionBatteryLevel,
            hidden:true,
            sortable: false,
            defaults:{
                margin:'-31 0 0 55'
            },
            items: [{
                xtype: 'numberfield',
                id: 'batteryFilter',
                align:'right',
                listeners: {
                     change (e,newValue, oldValue, eOpts ) {
                        filterGridAttributeType(newValue,'batteryLevel');
                    }
                }
            }],
       },{
            ...

【问题讨论】:

    标签: css extjs grid alignment


    【解决方案1】:

    有一个用于对齐内容的列配置:

    columns: [{
            text: 'Battery Level',
            sortable: false,
    ==>     align: 'end'
       },{
            ...
    

    【讨论】:

    • 不幸的是,什么都没有改变:(
    • 或者无论如何它会在右边对齐行的内容,而不是标题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-26
    • 1970-01-01
    • 1970-01-01
    • 2017-06-18
    • 2017-09-27
    • 1970-01-01
    相关资源
    最近更新 更多