网上答案说是因为Easy-ui在低版本时应将class样式删去,而在javascript里写url,因为class里有url的话javascript里也存在url,就会使页面刷新俩次,但是测试后没有解决我的问题,后来通过反复测试终于找到问题,
<ul id="eva" style=" font-size:25px; ">
</ul>因为在页面写了style,将style里的样式删去就可以解决问题了,现附上完整的ajax动态树和Grid表格代码。
<html>
<head>
<title>Tree</title>
<link href="../../Content/JQEasyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="../../Content/JQEasyUI/themes/icon.css" rel="stylesheet" />
<script src="../../Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.unobtrusive-ajax.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../Scripts/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript">
var NodeText;
var time;
var treeeva;
$(function () {
initTable();
$("#SelectForm").css("display", "none");
bindSearcheClick();
$('#eva').tree({
url: '/OEE/GetTree',
method: 'get',
animate: true,
checkbox: true
});
});
//初始化表格
function initTable() { $('#tt').datagrid({
url: '/OEE/Details',
title: 'OEE',
width: 700,
height: 360,
fitColumns: true,
idField: 'Fid',
loadMsg: '正在加载设备的信息...',
pagination: true,
singleSelect: false,
pageSize: 10,
pageNumber: 1,
pageList: [10, 20, 30],
queryParams: {//要传入的参数
NodeResult: NodeText,
SelectTime: $('#SelectTime').datebox('getValue')
},
columns: [[//{EID, ETypeName, ThenTypeInfoTID, EtypeNum}
{field: 'Num', title: '设备编号', width: 80, align: "center" },
{ field: 'Name', title: '设备名称', width: 80, align: "center" },
{ field: 'EarlyTimeOEE', title: '早班OEE', width: 80, align: "center" },
{ field: 'MiddleTimeOEE', title: '午班OEE', width: 80, align: "center" },
{ field: 'LaterTimeOEE', title: '晚班OEE', width: 80, align: "center" },
{
field: 'DelFlag', title: '操作', width: 80, align: 'center',
formatter: function (value, row, index) {
var str = "<a Fid='" + row.Fid + "' class='SelectInfo' href='javascript:void(0)'>明细</a> ";
return str;
}
}
]],
onHeaderContextMenu: function (e, field) {










