How can i override save button call?

Hi Team,

How can i override save button call. I want to right some logic at client side on click of save button.

What is the correct way of doing it.

Regards,

Deepak

Parents Reply Children
  • Hi Deepak Kumar

    create file on below place.

    custom/modules/<MODULE NAME>/clients/base/views/create/create.js

    ({
    extendsFrom: 'CreateView',
    initialize: function (options) {
    this._super('initialize', [options]);
    this.context.on('button:save_button:click', this._save_desc, this);
    },
    _save_desc: function (model) {
    console.log("Mehul Bhandari");
    },
    })

    custom/modules/<MODULE NAME>/clients/base/views/record/record.js

    ({
    extendsFrom: 'RecordView',
    initialize: function (options) {
    this._super('initialize', [options]);
    this.context.on('button:save_button:click', this._save_desc, this);
    },
    _save_desc: function (model) {
    console.log("Mehul Bhandari");
    },
    })

    Hope this Helpful to you...