Announcement

Collapse
No announcement yet.

Extending Parent view with a custom child view

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

  • Extending Parent view with a custom child view

    Is it possible to extend the crm:views/lead/detail view with my own custom view?

    I wanted to make some changes on the parent view by creating my custom view and extend it in the parent view. Currently, the alert() method is not being executed when I try the below code.

    Below code is an example of how I think to implement it.

    Please advise. Thanks!

    where,

    paramater 1 -> view name?
    parameter 2 -> parent view?

    PHP Code:
    Espo.define('Custom:Views.Lead.Detail''Crm:Views.Lead.Detail', function (Dep) {

        return 
    Dep.extend({

            
    setup: function (){
                
    Dep.prototype.setup.call(this);

            },
            
    afterRender: function(){
                 
    Dep.prototype.afterRender.call(this);
                 
    alert('Custom Child View Alert');
            }

        });
    }); 

  • #2
    Hello
    Did you override lead clientDefs? https://www.espocrm.com/documentatio.../custom-views/

    Comment


    • #3
      I did not override it, I want it to stay that way, and just make my own custom for upgrade safe.

      Is it possible to do that?

      Comment


      • #4
        You need to create a custom clientDefs, like in an article. And in views > detail set your view (Custom:Views.Lead.Detail). And your view extends native (Crm:Views.Lead.Detail)
        This customization is upgrade safe

        Comment


        • #5
          Ahh ok, nice, Thanks! its clear now.

          Comment

          Working...
          X