您的位置:首页 > Web前端 > JavaScript

ExtJS -- Grid 文本居中显示

2013-07-02 22:26 351 查看
Reference: http://stackoverflow.com/questions/6561120/extjs-4-apply-defaults-to-all-columns-in-a-grid

columns: {
items:[
{ header: "ID", dataIndex: "ID"},
{ header: "Name", dataIndex: "Name"}
],
defaults:{    // here, apply default config to each column
align: "center"
}
}


Sencha -- defaults :

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. ...
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: