... | ... | @@ -487,6 +487,29 @@ Auto forms do not allow override `initComponent` - it will just not work. |
|
|
But it is possible to define `initComponentStart` and do there manipulations with `items` collection, for example. Call of `callParent` is not required.
|
|
|
Data would not be ready by that moment, but `commandConfig` will be there.
|
|
|
|
|
|
```javascript
|
|
|
exports.formCode = {
|
|
|
initComponentStart: function () {
|
|
|
const me = this;
|
|
|
|
|
|
function removeAttribute(name) {
|
|
|
const itemIndex = _.findIndex(me.items, function (i) { return i.attributeName === name; });
|
|
|
if (itemIndex >= 0) {
|
|
|
me.items.splice(itemIndex, 1);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!this.isEditMode) {
|
|
|
removeAttribute('mi_dateTo');
|
|
|
removeAttribute('mi_dateFrom');
|
|
|
}
|
|
|
},
|
|
|
|
|
|
...
|
|
|
}
|
|
|
```
|
|
|
|
|
|
# Custom Forms and controls
|
|
|
|
|
|
## My custom form does not work
|
... | ... | |