Gantt.feature.TaskEdit#editorConfig is a configuration for Gantt.widget.TaskEditor. So that is covered.
Does not exactly apply here. The guide explains to move the extra widgets from features.taskEdit.editorConfig.extraItems to features.taskEdit.items. That means I must move the configuration from inside my custom TaskEditor class out to the taskEdit feature configuration. Right? If it is so, if it is really really so, it breaks my code but I'm fine with that.
defaultConfig was never public.
Does that mean I shouldn't use it? I can see it's "internal" but so is configurable()
and the latter is demonstrated in https://www.bryntum.com/docs/gantt/#Core/guides/advanced/widgets.md#the-widget-class so I'm not sure what the quick tip "This member should not be used by non-framework code" means exactly. My understanding is that private stuff is just not shown in the documentation.
"defaultConfig" is getting replaced with "configurable".
Thanks for the heads up. I will stop using it.
Anyway, I carefully read https://www.bryntum.com/docs/gantt/#Core/Base#property-configurable-static **. The example is clear, and works very well: the configurations of the Example and Example2 classes are merged, and this is what I expect. Unless you use let ex = new Example2();
then ex.config becomes { bar: {} }
. Strange. let ex = new Example2({config: {}});
is the least that can be used to get any expected result. But I digress
So I did some more tests and here's where it gets interresting: it merges fine, UNLESS there's an array. Then that array gets completely replaced:
class Example extends Base {
static get configurable() {
return {
config : {
foo : 1,
bar : [{
ref: 'first',
adjo: 'abc'
}, {
ref: 'second',
adjo: 'def'
}]
}
};
}
}
class Example2 extends Example {
static get configurable() {
return {
config : {
bar : [{
ref: 'second',
adjo: 'ghi'
}, {
ref: 'third',
adjo: 'jkl'
}],
zip : 'abc'
}
};
}
}
let ex = new Example2({config: { zip: 'xyz'}});
console.debug(ex.config);
// Expected result:
{
"bar": [{
"ref": "first",
"adjo": "abc"
}, {
"ref": "second",
"adjo": "ghi" // This one is updated
}, {
"ref": "third",
"adjo": "jkl"
}],
"foo": 1,
"zip": "xyz"
}
// Expected result if ref was not to be handled:
{
"bar": [{
"ref": "first",
"adjo": "abc"
}, {
"ref": "second",
"adjo": "def"
}, {
"ref": "second",
"adjo": "ghi"
}, {
"ref": "third",
"adjo": "jkl"
}],
"foo": 1,
"zip": "xyz"
}
// Actual result:
{
"bar": [{ // MISSING ONE!
"ref": "second",
"adjo": "ghi"
}, {
"ref": "third",
"adjo": "jkl"
}],
"foo": 1,
"zip": "xyz"
}
And that is what I'm experiencing. https://www.bryntum.com/docs/gantt/#Gantt/widget/TaskEditor#config-items has to be an array (see my original post) so it gets completely replaced. If I could refer to "tabs" with items: { tabs: {...} }
instead of items: [ { ref: 'tabs', ...} ]
then I believe the matter here would be over.
I'm sorry I don't mean to challenge you guys. What I did in 2.1.7 worked but maybe it was just wrong. I don't know The right strategy to use is a bit confusing and I just need to get it clear.
** There'a a typo: To support this, config options ca be declared like
** The result reads ex.foo = {
but should be ex.config = {