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

  • 相关阅读:
    Linux查看占用内存前10的命令
    使用RestTemplate调用SpringCloud注册中心内的服务
    Eureka集群配置
    MySQL常用命令集合(偏向运维管理)
    pytest: error: unrecognized arguments报错解决
    MongoDB的安装
    MongoDB多条件分组聚合查询
    在排序数组中查找元素的第一个和最后一个位置
    搜索二维矩阵
    搜索旋转排序数组
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/5809799.html
Copyright © 2011-2022 走看看