PDA

View Full Version : jQuery to EXTJS 2: Extending objects



JSCoder
18 Nov 2009, 5:50 AM
How can I do this in EXTJS?:


//consider two config objects

var options = {
age: 22
location: 'Fremont'
}

var defaults = {
age: 25
location: 'Austin'
}

var options = $.extend(defaults, options); //In EXT, this would be?

hendricd
18 Nov 2009, 5:52 AM
//In EXT, that would be

options = Ext.apply(defaults, options);

//For an unobtrusive mixin:

var finalOptions = Ext.apply({}, options, defaults);

JSCoder
19 Nov 2009, 11:53 PM
Thank you!