Would appreciate it if they were some explanation to functions createView() and Espo.define() in js files, mainly the parameters on github. I understand the first parameter in Espo.define() is the name of the file itself, third parameter is the function, but not understanding the second parameter.
More explanations on github
Collapse
X
-
Tags: None
-
The second parameter in Espo.define() is the child view's name, which the view inherit properties and behaviours from -
Module system in EspoCRM is designed in AMD approach.
createView creates child view. If you call it in setup method it will be rendered automatically when the parent view is rendered. If you call createView after parent view has been already rendered you will need to render it manually in the callback.
PHP Code:afterRender: function () { this.createView('someKey', 'custom:views/some-view', { el: this.options.el + ' .some-container' // container selector, model: this.model // model passed to child view }, function (view) { view.render(); }); }
Last edited by yuri; 01-13-2016, 01:26 PM.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
Comment