我们在ext—grid中经常遇到内容过长,换行问题。有以下2中方法:
1、使用rendere方法
{
header: '工作内容',
flex: 1,
dataIndex: 'PLAN_CONTENT',
minWidth: 100,
renderer: function (value, meta, record) {
meta.attr = 'style="white-space:normal;"';
if (value) {
return value;
}
}
}
2、修改css文件(ext默认的样式文件ext-all.css 中 .x-grid3-cell-inner 改动 white-space,)
.x-grid-cell-inner {
//原来是:white-space: normal 这属性
white-space: normal !important;
}