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();
    }

  • 相关阅读:
    python 类的私有属性和方法 (转载)
    python 子类继承父类__init__(转载)
    python 面向对象(类)--学习笔记
    python 迭代器 生成器
    python 从csv文件插入mysql数据库
    python 异常处理【转载】
    大数据-hadoop学习记录
    重看计算机基础1:数据线、地址线,按字、按字节寻址。
    利用requirejs实现vue的模块化开发
    开发vue但不使用vue-cli和webpack相关注意事项
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/5809799.html
Copyright © 2011-2022 走看看