设置数字网格列的样式
我也在 Sencha 论坛上问过这个问题..但没有收到任何答案..它阻碍了我对锁定网格的实现...我希望你们中的一个人知道答案..
使用 ExtJS 4.. 。 我正在尝试让我的网格列是数字,以便文本正确对齐...... 我尝试了网格常见问题解答(http://www.sencha.com/learn/Ext_FAQ_Grid)中关于在 def 列中使用 CSS 的建议,但它不起作用。我做错了什么?
以下是我的其中一个需要右对齐的列的代码:
text : 'ROAMING',
width : 125,
sortable : true,
css : "text-align : right;",
dataIndex: 'ROAMING'},
在 Firebug 中展开时,该列的网格单元在网格的第一行中看起来像这样:
<td class=" x-grid-cell x-grid-cell-gridcolumn-1032 ">
<div class="x-grid-cell-inner x-unselectable"
style="; text-align: left;" unselectable="on">0</div>
</td>
这清楚地表明该字段被解释为左对齐。 。
谢谢, - 起诉
I asked this over on the Sencha forum as well..but haven't received any answers..it is holding up my implementation of the locking grid...I am hoping one of you knows the answer..
using ExtJS 4...
I am trying to get my grid columns that are numbers to have text-align right...
I tried the suggestion in the grid faq (http://www.sencha.com/learn/Ext_FAQ_Grid) of using CSS in the column def..but its not working. What am I doing wrong?
Here is the code for one of my columns that needs to be right aligned:
text : 'ROAMING',
width : 125,
sortable : true,
css : "text-align : right;",
dataIndex: 'ROAMING'},
the grid cell for this column looks like this for the first row of the grid when expanded in Firebug:
<td class=" x-grid-cell x-grid-cell-gridcolumn-1032 ">
<div class="x-grid-cell-inner x-unselectable"
style="; text-align: left;" unselectable="on">0</div>
</td>
which clearly shows the field is being interpreted as align left...
Thanks,
--Sue
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 'css' 更改为 'align',并将值设置如下:
我昨天第一次在 ExtJS 4 中这样做,我很惊讶它是如此简单。我主要感到惊讶的是,旧版本的 ExtJS 有如此多的搜索结果,人们采用奇特的方式来实现网格对齐。
...我希望这对您的情况也有帮助:)
Change 'css' to 'align', and set the value as below:
I did this yesterday in ExtJS 4 for the first time, and I was surprised that it was that easy. I was mainly surprised because older versions of ExtJS have so many search results with people implementing exotic ways to get grid aligning.
...I hope that helps in your situation as well :)