URL: http://www.extjs.com/forum/showthread.php?56893-table-layout-cellspacing-and-custom-
CSS-class
How about:
Code:
Ext.override(Ext.layout.TableLayout, {
tableCfg: {tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}},
onLayout : function(ct, target){
var cs = ct.items.items, len = cs.length, c, i;
if(!this.table){
target.addClass('x-table-layout-ct');
this.table = target.createChild(this.tableCfg, null, true);
this.renderAll(ct, target);
}
}
});
so you can use:
Code:
{
xtype : 'container',
autoEl: {},
layout : 'table',
layoutConfig: {
tableCfg: {tag:'table', cls:'x-table-layout', cellspacing: 10, cn: {tag: 'tbody'}}
},
items : [ ... ]
}
本文介绍如何在ExtJS中自定义TableLayout的样式及间距,通过覆盖TableLayout的方法实现定制化的表格布局,并展示了具体的代码实例。
2343

被折叠的 条评论
为什么被折叠?



