kul*_*rim 6 javascript grid extjs
我需要将单元格文本对齐到右侧。
{
            xtype : 'numbercolumn',
            dataIndex : 'lineAmount',
            id : 'lineAmount',
            header : 'Net Line amount',
            sortable : true,
            width : 150,
            summaryType : 'sum',
            css: 'text-align: rigth;',
            summaryRenderer : Ext.util.renderers.summary.sum,
            editor : {
                xtype : 'numberfield',
                allowBlank : false
            }
添加align属性对我不起作用,因为它还会对齐标题文本
存在一个numbercolumn名为的配置align。只是用那个。
每当您遇到困难时,都可以参考专门为初学者设计的secha文档。
我假设您是新手,并向您说明如何使用docs ..,以便您清楚地理解:



align: "right"在下面的“ 代码编辑器 ”中添加代码。
更新
.columnAlign{
     text-align: right;
}
tdCls: "columnAlign",
正如 Mr_Green 的回答,您可以使用align将文本向右或向左对齐 。为了使标题保持居中对齐,请使用 css 作为:
.x-column-header-inner{
    text-align:center;
 }
更新:
......//
  {
    xtype : 'grid',
    cls   : 'gridCss',
    ...//other configs
  }
......//
在你的 app.css 文件中:
 .gridCss .x-column-header-inner{
    text-align:center;
 }
在你的index.jsp中
<link rel="stylesheet" type="text/css" href="app/resources/css/app.css">
| 归档时间: | 
 | 
| 查看次数: | 17277 次 | 
| 最近记录: |