zoukankan      html  css  js  c++  java
  • BPM实例分享:设置控件只读

    适用于需要根据其余字段赋值显示的字段。

    比如选择人员后自动带出的部门,比如某些需要动态禁用的字段。

    针对sheetuser类型的字段,如部门,人员,适用如下方法 ,field为字段名,如果明细行,在field后增加行参数即可

    //设置控件无法点击

            function setDisabled(field) {

                $.MvcSheetUI.GetElement(field).find("*").each(function () {

                    $(this).unbind('click')

                        .unbind('focusin')

                        .prop("disabled", true);

                });

            }

    针对下拉选择框,适用如下方法

    $.MvcSheetUI.GetElement(field).prop("disabled", false)

    针对弹出选择框

    function setTextBoxReadonly(field, row, b) {

                var ele = $.MvcSheetUI.GetElement(field, row);

                var sheetText = ele.SheetUIManager();

                var textLable = ele.parent().find("label");

                if (b) {

                    ele.hide();

                    if (textLable != null && typeof (textLable) != "undefined") {

                        textLable.remove();

                    }

                    var lbl = $("");

                    if (sheetText.TextRightAlign) lbl.addClass("txtAlignRight").css("width", ele.width());

                    else if (sheetText.NumberRightAlign && sheetText.IsNubmer()) { lbl.addClass("txtAlignRight"); }

                    var val = $.trim(sheetText.GetValue());

                    if (val != "") {

                        var strs = val.split(" ");

                        $(strs).each(function (i) {

                            if (i > 0) {

                                lbl.append("

    ");

                            }

                            lbl.append($("").text(this.toString()));

                        });

                    }

                    lbl.insertAfter(ele);

                    sheetText.GetFromatValue(lbl, sheetText.GetValue());

                    ele.nextAll("a").hide();

                }

                else {

                    ele.show();

                    if (textLable != null && typeof (textLable) != "undefined") {

                        textLable.remove();

                    }

                    ele.nextAll("a").show();

                }

            }

  • 相关阅读:
    Oracle spatial、openlayers、geoserver开发地理信息系统总结
    解决Geoserver请求跨域的几种思路,第二种思路用过
    OpenLayers中的球面墨卡托投影
    墨卡托投影、地理坐标系、地面分辨率、地图比例尺
    jQuery Easing 动画效果扩展
    jQuery实现鼠标移上弹出提示框,移出消失
    验证码生成组件--JCaptcha的使用
    jquery validate 验证
    Oracle查询错误分析:ORA-01791:不是SELECTed表达式
    启动tomcat报host-manager does not exist or is not a readable directory异常
  • 原文地址:https://www.cnblogs.com/liuchengkong/p/6626518.html
Copyright © 2011-2022 走看看