ExtJS -- Grid 文本居中显示

本文介绍了如何在ExtJS 4中为网格的所有列应用默认配置,包括设置列的对齐方式为居中。通过使用defaults选项,可以统一地为网格中的所有列设置默认属性,从而简化了开发过程。

Reference: http://stackoverflow.com/questions/6561120/extjs-4-apply-defaults-to-all-columns-in-a-grid

1 columns: {
2     items:[
3         { header: "ID", dataIndex: "ID"},
4         { header: "Name", dataIndex: "Name"}
5     ],
6     defaults:{    // here, apply default config to each column
7         align: "center"
8     }
9 }

Sencha --   : 

This option is a means of applying default settings to all added items whether added through the items config or via the add or insert methods.

If an added item is a config object, and not an instantiated Component, then the default properties are unconditionally applied. If the added item is an instantiated Component, then the default properties are applied conditionally so as not to override existing properties in the item.

If the defaults option is specified as a function, then the function will be called using this Container as the scope (this reference) and passing the added item as the first parameter. Any resulting object from that call is then applied to the item as default properties. ...

 

转载于:https://www.cnblogs.com/ccding13/p/3168558.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值