esayui datagrid 列内容超长自动换行

列自动换行 其实很简单 首先 datagrid 增加 nowrap: false 属性,

然后重写     datagrid-cell
 <style type="text/css">
      .datagrid-cell
      {
          word-break:break-all
      }
</style>  成功!

<!DOCTYPE HTML>
<html>
<head>
<title>列换行</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="she,sypro,sshe,springmvc,hibernate">

<script type="text/javascript" src="js/easyui/jquery.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/easyui/jquery.easyui.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/easyui/locale/easyui-lang-zh_CN.js" charset="UTF-8"></script>
<link rel="stylesheet" href="js/easyui/themes/icon.css" type="text/css"></link>

<link id="easyuiTheme" rel="stylesheet" href="js/easyui/themes/default/easyui.css" type="text/css"></link>
<script type="text/javascript">
	
		 $(function () {
    		var data="[{'ID':1070000004,'NAME':'门禁卡1','TOTALCOST':'500','COSTDATE':'2015-07-23','CZY':'陈硕','REMARK':'asdasdasdasdasdasdasdasdasdasdsadasdasdasdasdasdasdasdacxzczxczxczxczxczxczxcxxxxxxxxxxxxxxxxxxxxxx'},{'ID':1070000003,'NAME':'水卡','TOTALCOST':'2500','COSTDATE':'2015-07-23','CZY':'陈硕','REMARK':null},{'ID':1070000021,'NAME':'水卡22补货','TOTALCOST':'200','COSTDATE':'2015-08-04','CZY':'陈硕','REMARK':null}]";	
            $('#payList').datagrid({
                title: '',
                loadMsg: "数据加载中,请稍后……",
                nowrap: false,
                //url: '${pageContext.request.contextPath}/payController/list.action',
                singleSelect:true,
                fit:true,
                fitColumns:true,
                columns: [[
                    { field: 'NAME', title: '名称', width: 120, align: 'center' },
                    { field: 'TOTALCOST', title: '费用', width: 100, align: 'center'},
                    { field: 'COSTDATE', title: '日期', width: 100, align: 'center'},
                    { field: 'CZY', title: '操作员', width: 100, align: 'center'},
                    { field: 'REMARK', title: '备注', width: 100, align: 'center' }
                ]]
            });
             $("#payList").datagrid('loadData',  eval('(' + data + ')'));
        });
    


</script>
</head>
<style type="text/css">
      .datagrid-cell
      {
          word-break:break-all
      }
</style>
            
<body>
	 <table id="payList"   style="width:400px;height:250px" >
    </table>
    
</body>
</html>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值