
easyui 在layout中嵌套一个datagrid,layout能正常显示,但是datagrid不显示的问题?
<divid="cc"class="easyui-layout"style="width:1350px;height:900px;"><divdata-options="...
<div id="cc" class="easyui-layout"
style="width: 1350px; height: 900px;">
<div data-options="region:'west',title:'选择检查项',split:true"
style="width: 940px; height: 900px">
<table id="t1"></table>
</div>
下面是js写法
<script type="text/javascript">
$(function() {
$("#t1").datagrid( {
url : '<%=path%>/jsp/data1.json',
fitColumns : true,
nowrap : true,
striped : true,
fit : true,
columns : [ [ {
field : 'max_check',
title : '检查大类',
width : 100
}, {
field : 'min_check',
title : '检查小类',
width : 100
}, {
field : 'content_check',
title : '检查内容',
width : 100
}, {
field : 'person',
title : '主负责人',
width : 100
}, {
field : 'cycle',
title : '周期',
width : 100
} ] ]
});
})
json串书写正确,引用也正确。但是页面显示的时候datagrid就是显示不出来,求大神指教。 展开
style="width: 1350px; height: 900px;">
<div data-options="region:'west',title:'选择检查项',split:true"
style="width: 940px; height: 900px">
<table id="t1"></table>
</div>
下面是js写法
<script type="text/javascript">
$(function() {
$("#t1").datagrid( {
url : '<%=path%>/jsp/data1.json',
fitColumns : true,
nowrap : true,
striped : true,
fit : true,
columns : [ [ {
field : 'max_check',
title : '检查大类',
width : 100
}, {
field : 'min_check',
title : '检查小类',
width : 100
}, {
field : 'content_check',
title : '检查内容',
width : 100
}, {
field : 'person',
title : '主负责人',
width : 100
}, {
field : 'cycle',
title : '周期',
width : 100
} ] ]
});
})
json串书写正确,引用也正确。但是页面显示的时候datagrid就是显示不出来,求大神指教。 展开
1个回答
展开全部
1 你要确保数据确实有,但是就是不显示。否则别闹这种乌龙事件。
2 如果数据缺失存在,那就有可能是fit:true惹的祸。
你的window没有定义大小码?在cc里面定义一个width,height后再试试。
这时候就是有数据,但是剪裁datagrid的区域时把内容给隐藏掉了。
最简单的检测方式。可以打开页面源代码,找到数据那个地方,Html页面也确实有,但是看起来就是不显示。那就基本是这问题
2 如果数据缺失存在,那就有可能是fit:true惹的祸。
你的window没有定义大小码?在cc里面定义一个width,height后再试试。
这时候就是有数据,但是剪裁datagrid的区域时把内容给隐藏掉了。
最简单的检测方式。可以打开页面源代码,找到数据那个地方,Html页面也确实有,但是看起来就是不显示。那就基本是这问题
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询