for example how do i invoke the original setup() in my own setup() ?
How to call original function of customized view?
Collapse
X
-
Hi,
if understand your question, a sample I use.. you must inherit :
else all is explain here : https://github.com/espocrm/documenta...ustom-views.md
PHP Code:Espo.define('custom:views/meeting/detail', 'crm:views/meeting/detail', function (Dep) { return Dep.extend({ setup: function () { Dep.prototype.setup.call(this);
If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks. -
So my current code now is this. I had some trouble with extending the events property, because it would delete all other events if I defined only my own, so I used delegateEvents. Is there a better way like the __APPEND__ used for metadata customizations?
PHP Code:Espo.define('custom:views/lead/fields/phone', 'views/fields/phone', function (Dep) { return Dep.extend({ setup: function () { this.events['click selector'] = function (e) { /* ... code ... */ }.bind(this); this.delegateEvents(); // reload events. is this the best way? Dep.prototype.setup.call(this); // call original setup } });});
Last edited by tothewine; 01-29-2019, 10:19 AM.Comment
-
Sorry,
never make a custom view for field type. if you can share code, maybe i will try.
but you can add more inherit like this :
PHP Code:Espo.define('custom:views/lead/fields/phone', ['views/fields/phone', 'view/....' ], function (Dep) { return Dep.extend({
If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.Comment
Comment