I have a custom grid class (extending ListGrid) with auto children for buttons in it. I now want to use this grid itself as auto child of a Controller class. When the grid is part of this controller, I want some properties of the buttons different. I was wondering if this can be changed via changeDefaults(). I have a working thing by changing the *Properties, but was wondering if this is the right approach.
Any comments on this?
Code:
isc.defineClass('MyGrid', isc.ListGrid).addProperties({
createButtonConstructor: 'ToolStripButton',
createButtonDefaults: {
title: 'Show',
click: function() {
doSomething();
}
}
});
isc.defineClass('MyController', isc.TabSet).addProperties({
gridConstructor: 'MyGrid',
gridDefaults: {
init: function() {
this.createButtonProperties = isc.addProperties({
click: function() {
doSomethingElse(); // this is different when the grid is inside a controller, the title remains the same
}
}, this.createButtonProperties);
this.Super('init', arguments);
}
}
});
// something like this seems to be impossible
isc.MyController.changeDefaults('gridProperties.createButtonDefaults', {
...
});
Comment