javascript - 如何在 ExtJS GridPanel 的列中居中放置图像?

标签 javascript css extjs

我想将“数据”列中的图标水平居中:

enter image description here

我的专栏上有 textAlign: center:

enter image description here

在图标渲染器函数中,我使用 CSS 将其水平居中:

enter image description here

但它仍然是左对齐的。

我还需要做什么才能使列中的图标水平居中?

最佳答案

将 align: 'center' 添加到 actioncolumn 项就可以了,如下所示:

{
   xtype: 'actioncolumn',
   text: 'Edit',
   align: 'center',
   items: [{**}]
}

关于javascript - 如何在 ExtJS GridPanel 的列中居中放置图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5014860/

相关文章:

javascript - 是否可以从 javascript 手动引导 ng2+ 应用程序?

javascript - Angular UI Datepicker 限制每月天数

html - Bootstrap : Equal height of nested col-md-* elements

javascript - Ext JS 的自定义缓存设置

javascript - ExtJs4 - 存储 baseParams 配置属性?

extjs - 访问 Nexus 配置 - Ext.JSON.decode() : You're trying to decode an invalid JSON String:

Javascript:数组中的对象,包含带有id的对象

javascript - 变量不保留值

html - CSS 的 vertical-align 属性起作用的条件是什么?

jquery - 需要正确的内联 jQuery 语法来更改 fancybox 尺寸