Announcement

Collapse
No announcement yet.

More explanations on github

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • More explanations on github

    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.

  • #2
    The second parameter in Espo.define() is the child view's name, which the view inherit properties and behaviours from

    Comment


    • #3
      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', {
               
      elthis.options.el ' .some-container' // container selector,
               
      modelthis.model // model passed to child view
           
      }, function (view) {
              
      view.render();
          });

      Last edited by yuri; 01-13-2016, 01:26 PM.

      Comment

      Working...
      X