标签:
<!--用于判断页面传值控制界面是否只读-->
<script>
function checkType() {
var aQuery = window.location.href.split("?"); //取得Get参数
var aGET = new Array();
if (aQuery.length > 1) {
var aBuf = aQuery[1].split("&");
for (var i = 0, iLoop = aBuf.length; i < iLoop; i++) {
var aTmp = aBuf[i].split("="); //分离key与Value
aGET[aTmp[0]] = aTmp[1];
}
}
return aGET;
}
//窗体禁用
function readDisableControls() {
$(document).contents().find(".easyui-textbox").each(function () {
jQuery("#" + this.id).textbox("disable", true);
});
$(document).contents().find(".easyui-databox").each(function () {
jQuery("#" + this.id).databox("disable", true);
});
$(document).contents().find(".easyui-datetimebox").each(function () {
jQuery("#" + this.id).datetimebox("disable", true);
});
$(document).contents().find(".easyui-combobox").each(function () {
jQuery("#" + this.id).combobox("readonly", true);
});
$(document).contents().find(".easyui-combo").each(function () {
jQuery("#" + this.id).combo("readonly", true);
});
$(document).contents().find(".easyui-filebox").each(function () {
jQuery("#" + this.id).filebox("disable", true);
});
$(document).contents().find(".easyui-linkbutton").each(function () {
jQuery("#" + this.id).linkbutton("disable", true);
});
$(document).contents().find(".easyui-datagrid").each(function () {
jQuery("#" + this.id).datagrid("disable", true);
});
$(document).contents().find("a").each(function () {
jQuery("#" + this.id).attr("href", "javascript:void(0)");
});
$(document).contents().find("checkbox").each(function () {
jQuery("#" + this.id).attr("readonly",true);
});
}
</script>
if (checkType()["t"] == "read") {
readDisableControls();
}
标签:
原文地址:http://www.cnblogs.com/zhang-wenbin/p/5809799.html