Ext.define('MyWrapper', {
excludeProps: ['layout', 'appType' , 'app', 'id', 'x', 'y', 'width', 'height'],
dashboardPropsEqual: function (o1, o2) {
var me = this;
var result = true;
if (Ext.isArray(o1) || Ext.isArray(o2)) {
if (Ext.isArray(o1) && Ext.isArray(o2)) {
if (o1.length === o2.length) {
Ext.each(o1, function (o1Value, index) {
result = me.dashboardPropsEqual(o1Value, o2[index]);
if (!result) {
return false; // breaking the loop
}
});
} else {
result = false; // different lengths
}
} else {
result = false; // one of them is not an array
}
} else {
if (Ext.isPrimitive(o1) || Ext.isPrimitive(o2)) {
result = o1 === o2;
} else {
var cleanupKeys = function (keys) {
Ext.each(me.excludeProps, function (excludeMe) {
Ext.Array.remove(keys, excludeMe); //removing key which are in exclude list
});
return keys;
};
var keys1 = cleanupKeys(Ext.Object.getKeys(o1));
var keys2 = cleanupKeys(Ext.Object.getKeys(o2));
if (!Ext.Array.equals(Ext.Array.sort(keys1), Ext.Array.sort(keys2))) {
result = false;
} else {
var allKeys = Ext.Array.union(keys1, keys2);
Ext.each(allKeys, function (key) {
result = me.dashboardPropsEqual(o1[key], o2[key]);
if (!result) {
return false; //...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.