JQEasy-ui在IE9以下版本中二次加载的问题分析及处理方法
更新时间:2014年06月23日 10:59:05 投稿:hebedich
之前项目中才用了Easy-ui,但是在同时使用tree和grid的效果时,因为页面有俩个URL,分别为Ajax树去后台取数据和Grid取数据,在IE9以上以及其他浏览器里都没有问题,在Ie低版本时会出现先加载表格,然后一闪而过加载树渲染页面,造成页面只有tree数据而没有表格grid数据。
网上答案说是因为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) {
},
onLoadSuccess: function (data) {
$(".SelectInfo").unbind("click");
$(".SelectInfo").bind("click", function () {
doSelect($(this).attr("Fid"), time);
return false;
});
}
});
}
function doSelect(Fid, Time) {
var reg = new RegExp("-", "g");
var strobj = Fid.toString();
var newstr = strobj.replace(reg, "$");
$('#SelectFrame').attr('src', '/OEE/GetSelectInfo/' + Fid + '/' + Time);
$('#SelectForm').css('display', 'block');
$('#SelectForm').dialog({
width: 470,
height: 470,
modal: true,
title: "显示明细信息",
collapsible: true,
minimizable: true,
maximizable: true,
resizable: true,
buttons: [{
id: 'btnSelect',
text: '确定',
iconCls: 'icon-add',
handler: function () {
$("#SelectForm").dialog("close");
}
}]
});
}
//绑定搜索查询的 点击事件
function bindSearcheClick() {
//linkButtonSearch
$("#linkButtonSearch").click(function () {
var nodes = $('#eva').tree('getChecked');
var s = '';
for (var i = 0; i < nodes.length; i++) {
if (s != '') s += ',';
s += nodes[i].id;
}
NodeText = s;
time = $('#SelectTime').datebox('getValue');
initTable();
});
}
</script>
</head>
<body>
<div style="width: 1000px">
<div style="width: 200px; float: left">
<div style="margin: 23px 0;">
</div>
<div class="easyui-panel" style="padding: 5px; border-radius: 5px;">
<ul id="eva" >
</ul>
</div>
</div>
<div id="Right">
<div id="query">
查询时间:<input class="easyui-datebox" name="SelectTime" id="SelectTime" />
<a id="linkButtonSearch" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search'">
查询</a>
</div>
<table id="tt" style="width: 700px;" title="标题" iconcls="icon-edit">
</table>
<div id="SelectForm">
<iframe id="SelectFrame" src="javascript:void(0)" frameborder="0" width="100%" height="100%">
</iframe>
</div>
</div>
</div>
</body>
</html>
您可能感兴趣的文章:
- JQuery EasyUI 日期控件如何控制日期选择区间
- jquery easyui 结合jsp简单展现table数据示例
- jquery easyui 对于开始时间小于结束时间的判断示例
- jquery easyui中treegrid用法的简单实例
- Jquery EasyUI的添加,修改,删除,查询等基本操作介绍
- jquery easyui滚动条部分设置介绍
- jQuery easyui datagrid动态查询数据实例讲解
- jQuery EasyUI API 中文文档 - TreeGrid 树表格使用介绍
- jQuery EasyUI API 中文文档 - Tree树使用介绍
- jQuery EasyUI API 中文文档 - DataGrid数据表格
- jQuery EasyUI API 中文文档 DateTimeBox日期时间框
- jQuery EasyUI API 中文文档 - ComboGrid 组合表格
- jQuery EasyUI API 中文文档 - ComboBox组合框
- jQuery EasyUI API 中文文档 - ValidateBox验证框
- jQuery EasyUI API 中文文档 - Form表单
- jQuery EasyUI API 中文文档 - Panel面板
- Jquery插件 easyUI属性汇总
- jquery EasyUI的formatter格式化函数代码
- JQuery EasyUI 对话框的使用方法
- jQuery EasyUI 的EasyLoader功能介绍
- 初试jQuery EasyUI 使用介绍
相关文章
Jquery对新插入的节点 绑定Click事件失效的解决方法
下面小编就为大家带来一篇Jquery对新插入的节点 绑定Click事件失效的解决方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2016-06-06
JQuery实现的购物车功能(可以减少或者添加商品并自动计算价格)
这篇文章主要介绍了JQuery实现的购物车功能(可以减少或者添加商品并自动计算价格),本文的这个模拟实现的购物车难登大雅之堂,但是可以从中得到一些启发或者相关的知识点,需要的朋友可以参考下2015-01-01
扩展easyui.datagrid,添加数据loading遮罩效果代码
easyui可以说是轻量级的前端UI框架,更新到1.2.1支持更多的事件,方法和属性2010-11-11


最新评论