Extjs/js两个对象的属性进行混合
2013-11-20 23:33
519 查看
/* * @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 ){ for( var 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; }
来自为知笔记(Wiz)
来自为知笔记(Wiz)
相关文章推荐
- js数组排序,根据数组中对象的某一属性进行排序 支持数字和字符串的排序,也支持按两个属性进行排序
- js 按照对象某一个属性进行排序
- 根据对象的某一属性进行排序的js代码(如:name,age)
- js中怎么根据数组对象中的两个属性来取第三个属性的值
- java使用反射机制将两个对象共有的属性进行复制value值
- 根据对象的某一属性进行排序的js代码(如:name,age)
- 根据对象的某一属性进行排序的js代码(如:name,age)
- js,jquery 根据对象某一属性进行排序
- 透析Extjs的Ext.js源码(一)对象属性的添加和设置
- JS判断两个对象相同属性的属性值是否相等
- 使用Java对两个对象的属性进行拷贝
- Object.keys()js 把对象按照属性名的字母顺序进行排列
- js根据数组对象中某属性进行排序
- 开发中“错误: 意外地调用了方法或属性访问。” 和 第一行错误 的IE 两个问题( JQ 进行转义字符 , 分页JS 调用 时参数问题。)
- js根据对象的某一属性进行排序
- Object.keys()js 把对象按照属性名的字母顺序进行排列
- 反射实现两个对象属性名不同之间的映射
- js 获取一个对象中的所有属性
- JS对两个TEXTAREA进行同步
- js-window对象的方法和属性资料