其他分享
首页 > 其他分享> > dhtmlx中的grid加载不了数据

dhtmlx中的grid加载不了数据

作者:互联网

我是一个初学者,求大神帮我看下这data为什么加载不了
<script type="text/javascript">
var data={rows:[{ "id":"1",data:["烟雾测试","金华尾气检测站","423cvhjj","1233676uvy894",08,"2011-1-1","2011-1-1","运行"]},
{ "id":"2",data:["烟雾测试","金华尾气检测站","423cvhjj","1233676uvy894",04,"2011-1-1","2011-1-1","运行"]},
{ "id":"3",data:["烟雾分析仪","义乌尾气检测站","423cvhjj","1233676uvy894",02,"2011-1-1","2011-1-1","运行"]},
{ "id":"4",data:["烟雾分析仪","永康尾气检测站","423cvhjj","1233676uvy894",05,"2011-1-1","2011-1-1","运行"]},
{ "id":"5",data:["烟雾测试","永康尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","故障"]},
{ "id":"6",data:["烟雾分析仪","义乌尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","故障"]},
{ "id":"7",data:["烟雾分析仪","武义尾气检测站","423cvhjj","1233676uvy894",03,"2011-1-1","2011-1-1","故障"]},
{ "id":"8",data:["烟雾测试","永康尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","故障"]},
{ "id":"9",data:["烟雾分析仪","义乌尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","故障"]},
{ "id":"10",data:["烟雾分析仪","武义尾气检测站","423cvhjj","1233676uvy894",03,"2011-1-1","2011-1-1","维护"]},
{ "id":"11",data:["烟雾测试","永康尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","维护"]},
{ "id":"12",data:["烟雾分析仪", "义乌尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","维护"]},
{ "id":"13",data:["烟雾分析仪","武义尾气检测站","423cvhjj","1233676uvy894",03,"2011-1-1","2011-1-1","故障"]},
{ "id":"14",data:["烟雾分析仪","义乌尾气检测站","423cvhjj","1233676uvy894",01,"2011-1-1","2011-1-1","故障"]},
{ "id":"15",data:["烟雾分析仪","武义尾气检测站","423cvhjj","1233676uvy894",03,"2011-1-1","2011-1-1","维护"]}
]};
$(function(){
renderGrid();
var t = new dhtmlXCalendarObject(["CAR_S_DATE","CAR_E_DATE","START_DATE","END_DATE"]);
});
function renderGrid(){
dhxGrid = new dhtmlXGridObject("grid_body");
dhxGrid.setImagePath("${ctx}/plugin/dhtmlx/imgs/");
dhxGrid.setSkin("dhx_skyblue");
dhxGrid.setHeader("设备名称,站点名称,设备型号,设备类型,所属检测线,申请时间,标定有效期,状态");//设置头标题
dhxGrid.setInitWidthsP("12,12,12,12,12,12,12,20");
dhxGrid.setColAlign("center,center,center,center,center,center,center,center");
dhxGrid.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro");
dhxGrid.setColSorting("str,str,str,str,int,str,str,str");
dhxGrid.init();
dhxGrid.setPagingTemplates("[prevpages:<: ] [currentpages: ] [nextpages:>: ]","当前显示第<b>[from]-[to]</b>条,共<b>[total]</b>条");/
dhxGrid.setPagingWTMode(true,true,false,false);
dhxGrid.enablePaging(true,14, 14, "grid_foot",true,"grid_foot");
dhxGrid.setPagingSkin("toolbar", "dhx_skyblue");
dhxGrid.i18n.paging={
results:"结果",
records:"从第",
to:"条到第",
page:"页",
perpage:"条/页",
first:"首页",
previous:"上一页",
found:"找到记录",
next:"下一页",
last:"尾页",
of:" of ",
notfound:"未找到记录"
};

//var url = '${ctx}/searchVM.do?';
//url = encodeURI(encodeURI(url));
//dhxGrid.loadXML(url);
dhxGrid.parse(data,"json");
}
在body中的代码是
<div id="grid_div">
<div id="grid_body" ></div>
<div id="grid_foot" ></div>
</div>

 

发现原因了,只要在<div id="grid_body" ></div>输入height参数就行了

标签:dhxGrid,423cvhjj,data,grid,dhtmlx,1233676uvy894,检测站,2011,加载
来源: https://www.cnblogs.com/jijm123/p/16642662.html