esayui datagrid 列内容超长自动换行
2015-11-12 17:30
393 查看
列自动换行 其实很简单 首先 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>
相关文章推荐
- css设置表格自动换行;table换行无效
- (温故而知新)iOS开发UI篇—UITableview控件简单介绍
- UIView中的clipsTobounds属性及扩展
- UIScrollView
- Maltab gui 使用函数学习记录
- UITableView分割线式样 与 颜色设置
- UICollectionView 简单使用
- [ios]如何分组具有 UICollectionReusableView (使用 JSON) 的单元格
- 当UIScrollView 遇到 autolayout
- Elasticsearch Query String Query
- UIImage旋转详解
- GUI布局学习1
- UIScrollView上面添加的控件偏移
- easyui获取时间出错
- 实现加大UIButton/UITextField 的点击范围
- AndroidUI中gravity属性的运用
- 自定义UITableViewCell 上的多个按钮点击事件处理
- Github学习笔记2- Repository & Issue
- java,arduino,C#之间的一些编码转换
- iOS之UI高级---如何理解图文混排