Need to add customization to a common view, which is extended by every other view

Team,

I want to know a common view file where i could add my conditional customization,  so that i can apply my changes to multiple files.

Digging into the code  it seems like clients/base/views/base/base.js can be that file which could serve my requirement. but somehow BaseView is not getting overridden into the custom folder i.e. custom/clients/base/views/base/base.js with the below code snippet.

/**
* @class View.Views.Base.BaseCustomView
* @alias SUGAR.App.view.views.BaseCustomBaseView
* @extends View.BaseView
*/
({
extendsFrom: "BaseView",
initialize: function() {
console.log("Fdsfsdfds");
this._super('initialize', [options]);
},

})

Need help as soon as I can get.

Parents
  • Your approach will not work because all views which extends BaseView explicit inherit from it:

    Fullscreen
    1
    extendsFrom: "BaseView",
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Your approach will work for custom views which, eventually, extends your custom one:

    Fullscreen
    1
    extendsFrom: "CustomBaseView",
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • @Andre Lopes - I want to extend functionality of BaseView itself because most of the views inherit BaseView. My requirement is not to create any new custom view. The BaseView itself should add my customization everytime it gets called. 

    When i write my customization in the core file itself, it works as expected, but to make it upgrade safe, i am trying to move it to custom folder so that every time parent BaseView is called, it should also include my customization. 

  • As I previously explained and Sanchez agreeded, it is not possible to accomplish such a feature without creating custom views for all cascading views.

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • As I previously explained and Sanchez agreeded, it is not possible to accomplish such a feature without creating custom views for all cascading views.

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
No Data