• Extjs/js两个对象的属性进行混合


    /*
         * @param {Object} target 目标对象。 @param {Object} source 源对象。 @param {boolean}
         * deep 是否复制(继承)对象中的对象。 @returns {Object} 返回继承了source对象属性的新对象。
         */
        Mixing2Object : function ( target , source ,deep ){
            target = target || {};
            var sType = typeof source , i = 1 , options;
            if ( sType === 'undefined' || sType === 'boolean' ){
                deep = sType === 'boolean' ? source : false;
                source = target;
                target = this;
            }
            if ( typeof source !== 'object'
                && Object.prototype.toString.call( source ) !== '[object Function]' )
                source = {};
            while ( i <= 2 ){
                options = i === 1 ? target : source;
                if ( options != null ){
                    forvar name in options){
                        var src = target [name] , copy = options [name];
                        if ( target === copy )
                            continue;
                        if ( deep && copy && typeof copy === 'object' && !copy.nodeType )
                            target [name] =
                                this.extend( src || (copy.length != null ? [] : {}) , copy ,
                                  deep );
                        else if ( copy !== undefined )
                            target [name] = copy;
                    }
                }
                i++;
            }
            return target;
        }



  • 相关阅读:
    Postgresql HStore 插件试用小结
    postgres-xl 安装与部署 【异常处理】ERROR: could not open file (null)/STDIN_***_0 for write, No such file or directory
    GPDB 5.x PSQL Quick Reference
    postgresql 数据库schema 复制
    hive 打印日志
    gp与 pg 查询进程
    jquery table 发送两次请求 解惑
    python 字符串拼接效率打脸帖
    postgresql 日期类型处理实践
    IBM Rational Rose软件下载以及全破解方法
  • 原文地址:https://www.cnblogs.com/babyhhcsy/p/3434640.html
Copyright © 2020-2023  润新知