zoukankan      html  css  js  c++  java
  • 控件禁用

    <!--用于判断页面传值控制界面是否只读-->
    <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();
    }

  • 相关阅读:
    BZOJ2456: mode 众数卡空间
    BZOJ4128: Matrix 矩阵BSGS
    [SDOI2011]计算器 BSGS
    前台中文搜索到后台乱码
    批量删除实现js+springmvc
    基于Jquery+Ajax+Json实现分页显示
    分页条的制作
    input text中不能显示空格后的内容
    mysql存入中文乱码问题
    WEBROOT根目录 <%=request.getContextPath()%>
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/5809799.html
Copyright © 2011-2022 走看看