getModelFactory,getCollectionFactor(),createView()??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elbowprogrammer
    Member
    • Jan 2016
    • 58

    getModelFactory,getCollectionFactor(),createView()??

    Can someone explain getModelFactory(), getCollectionFactory(), and createView()? And how can I use separately and/or nested? Can I use either function, when user clicks a button, create a window filled with a few buttons that can view whatever I want?
  • yuri
    Member
    • Mar 2014
    • 8478

    #2
    PHP Code:
    this.getModelFactory().create('Meeting', function (model) {
       model.id = 'some id';
       model.fetch().done(function () {
           console.log(model.get('status'));
       }.bind(this));
    }, this); 
    
    createView - creates a nested view.
    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

    • elbowprogrammer
      Member
      • Jan 2016
      • 58

      #3
      In createview, how can I place a button onto the scope when viewing an entity?
      PHP Code:
      
      
      ​this.createView('Call','clientDefs.Call.modalViews.select',{  scope: 'Call',​  createButton: false  },function(view){    view.render();  self.notify(false);     this.listenToOnce(view,'select',function(model){     })  }) 
      
      Last edited by elbowprogrammer; 02-03-2016, 09:33 PM. Reason: found my answer to previous question, asking a different one that help me meet my deadline.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8478

        #4
        Sorry. This not very trivial question. Try to look to source code. It's possible to add buttons in record/detail view

        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

        Working...