EasyUI Datagrid 数据网格控制网格头部及内部内容换行

控制网格头部换行

通过在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>';
    }
}
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值