Open HalaSalameh opened 6 years ago
Hello HalaSalameh,
It is posible by using 2 ways.
First way: modifying the entery setting object I mean redefining
Second way: by creating a clone object of the settings object, then modify the cloned object and finally assining the memory reference to the original settings object. Example:
var clone = this.clone(this.settings);
clone.columns['new_col'] = {title: 'col_title'};
this.settings = clone;
//clone function:
clone(obj) {
if (null == obj || "object" != typeof obj) return obj;
var copy = obj.constructor();
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
}
return copy;
}
reagrds!
why cant we dynamically change the settings?