Hello,
This may seem like a basic question but how does one pass a custom field parameter from entityDefs so it can be read in the custom view?
In the example below I have a field called 'procedureFile' in my entity def. I want to pass the parameter 'myCustomParam' into the custom view but its always showing the default value false in my code?
Example:
//custom/Espo/Custom/Resources/metadata/entityDefs/MyEntity.json
//site/client/custom/src/views/fields/custom-file.js
This may seem like a basic question but how does one pass a custom field parameter from entityDefs so it can be read in the custom view?
In the example below I have a field called 'procedureFile' in my entity def. I want to pass the parameter 'myCustomParam' into the custom view but its always showing the default value false in my code?
Example:
//custom/Espo/Custom/Resources/metadata/entityDefs/MyEntity.json
Code:
"procedureFile": {
"type": "file",
"accept": [
".pdf"
],
"inlineEditDisabled": true,
"maxFileSize": 5,
"sourceList": [
"Document"
],
"isCustom": true,
"myCustomParam":true,
"view": "custom:views/fields/custom-file"
}
//site/client/custom/src/views/fields/custom-file.js
Code:
define('custom:views/fields/custom-file', ['views/fields/file'], function (Dep) {
return Dep.extend({
myCustomParam: false,
setup: function () {
Dep.prototype.setup.call(this);
this.myCustomParam = this.options.myCustomParam || this.params.myCustomParam || this.myCustomParam;
console.log(this.myCustomParam); // WHY IS THIS ALWAYS FALSE ??
},
});
});

Comment