hsnGunda
hsnGunda

Reputation: 347

Extjs4 how to use Ext apply having object inside object

Im using Ext.apply(obj1,configobject) in Extjs4; let us consider this sample example :

               var obj1 = {},
   configobject = {
    a: 'value',
    d: 'somevalue',
    c: {
        c1 : 10,
        c2 : 5,
        c3 : 4
    }
};
        Ext.apply(obj1, configobject);
         obj1.c={c2 : 25}
          document.write(obj1.c.c1 + ', ' + obj1.c.c2 + ', ' + obj1.c.c3);
                                    Now the value of obj.c.c1 and obj.c.c3 will show undefined, can anyone tell me the reason

Thanks

Upvotes: 0

Views: 894

Answers (1)

maxmalov
maxmalov

Reputation: 510

Ext.apply should work properly. Here is working sample http://jsfiddle.net/mWaZJ/

Upvotes: 1

Related Questions