how to refresh a side panel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abanoub
    Junior Member
    • Sep 2016
    • 23

    how to refresh a side panel

    I have added a side-panel and I want to refresh it on quick-create submission what am trying to do atm


    Espo.define('custom:views/section/detail', 'views/detail', function (Dep) { return Dep.extend({ setup: function () { Dep.prototype.setup.call(this); this.menu.buttons.push({ 'label': 'Create Sub-Section', 'action': 'createSubSection', }); }, actionCreateSubSection: function () { var scope = "Section"; var type = this.getMetadata().get(['clientDefs', scope, 'quickCreateModalType']) || 'edit'; var viewName = this.getMetadata().get(['clientDefs', scope, 'modalViews', type]) || 'views/modals/edit'; this.createView('quickCreate', viewName, { scope: scope, attributes: {parentName: this.model.attributes.name, parentId: this.model.id} }, function (view) { view.once('after:render', function () { Espo.Ui.notify(false); }); this.listenToOnce(view, 'close', function (models) { // what should I do here }); view.render(); }); } }); });
    how would I reload the model it self , then update the side-panel view , since the quick-create is going to effect the model itself?
  • yuri
    Member
    • Mar 2014
    • 8452

    #2
    this.model.fetch();
    or
    this.collection.fetch();
    or
    this.reRender();
    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

    • alasdaircr
      Active Community Member
      • Aug 2014
      • 525

      #3
      FYI, this.model.fetch() doesn't refresh the side panel.

      this.reRender() does however!

      Comment

      • alasdaircr
        Active Community Member
        • Aug 2014
        • 525

        #4
        but it requires a this.model.fetch() first!

        Comment

        Working...