easyui超出页面部分不显示

yaotomo 2018-05-12 10:05:45
可能是其他的样式影响的,
可是我设置了页面overflow:scroll 也不管用
把_Layout.cshtml模板里的样式去了也不管用?


@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<script type="text/javascript" src="~/Content/js/jquery-easyui-1.3.2/jquery.easyui.min.js"></script>
<script type="text/javascript" src="~/Content/js/custom/riskview.js"></script>
<link rel="stylesheet" href="~/Content/js/jquery-easyui-1.3.2/themes/icon.css" type="text/css" />
<link rel="stylesheet" href="~/Content/js/jquery-easyui-1.3.2/themes/default/easyui.css" type="text/css" />
<style type="text/css">
.datagrid-row
{
height:35px;
}
html, body
{
overflow:scroll;
}
</style>
</head>
<body>
<div class="z-toolbar">
<a id="a_query" href="#" plain="true" class="easyui-linkbutton" icon="icon-search" title="查询">查询</a>
</div>
<div id="condition" style="margin:10px 0 200px 0">
<div class="grid_1 lbl">整改内容</div>
<div class="grid_2 val"><input type="text" style="width:300px" class="z-txt easyui-autocomplete autocomplete validatebox-text" /></div>
</div>
<table id="dg"></table>
</body>
</html>



$(function () {
getRiskData();
})

function getRiskData() {
$('#dg').datagrid({
url: "/mms/RiskView/GetRiskData",
rownumbers: true,
singleSelect: true,
fit: true,
striped: true,
nowrap: false,
onSelect: function (rowIndex) {
$(this).datagrid("unselectRow", rowIndex);
},
columns: [[{
title: '内容',
field: 'RiskContent',
width: fixWidth(0.3)
}, {
title: '隐患级别',
field: 'RiskLevel',
align: "center",
width: fixWidth(0.1)
}, {
title: '整改日期',
field: 'CorrectiveDate',
align: "center",
width: fixWidth(0.1)
}, {
title: '责任单位',
field: 'ResponsibleDept',
align: "center",
width: fixWidth(0.1)
}, {
title: '整改责任人',
field: 'ResponsiblePerson',
align: "center",
width: fixWidth(0.1)
}, {
title: '督查落实人',
field: 'ImplementPerson',
align: "center",
width: fixWidth(0.1)
}, {
title: '整改落实情况',
field: 'ImplementDetail',
width: fixWidth(0.1)
}]],
onLoadSuccess: function (data) {
// alert(data);
}
})
}

function fixWidth(percent) {
return document.documentElement.clientWidth * percent; //这里你可以自己做调整
}


...全文
1523 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
TheEzreal 2018-05-16
  • 打赏
  • 举报
回复
fitColumns: true,是这个,自适应列宽; 可以加个横向的滚动条; 父容器的宽和高有没有设置好。
TheEzreal 2018-05-16
  • 打赏
  • 举报
回复
panel里有一个fit属性,自适应父容器,试一下
yaotomo 2018-05-12
  • 打赏
  • 举报
回复
下面是截图,其实datagrid里还有很多数据,但是显示不出来,超出浏览器就看不到了

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧