控制网格头部换行
通过在title内部加入 <br/ > 换行标签控制网格头部换行
{
field: "isInclude",
title: "是否为<br/>机构<br/>内人员",
align: "center",
width: 80,
rowspan: 2,
editor: {
type: 'combobox',
options: {
editable: false,
valueField: 'value',
textField: 'text',
data: [{'value': '0','text': '是'},
{'value': '1','text': '否'}],
required: true
}
},
formatter: function (value, row, index) {
if (value == 0) {
return "是";
} else {
return "否";
}
}
},
控制网格内部内容换行
nowrap:false 属性控制内容换行,默认的值是true
nowrap: false,
注意
网格内部内容为纯数字或者英文时nowrap属性不起作用,可通过如下方式格式化
{
field: "userWorkNo",
title: "工作证号",
width: 11,
align: "center",
formatter: function (value,row,index) {
return '<div style="word-break:break-all; word-wrap:break-word;">' + value + '</div>';
}
}