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.
Announcement
Collapse
No announcement yet.
More explanations on github
Collapse
X
-
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.
- Likes 1
Comment
Comment