AnsweredAssumed Answered

How to push fields to noEditFields

Question asked by Erik Hallin on Nov 7, 2016
Latest reply on Mar 14, 2017 by Angel Martinez

Hello,

I try to push "address fields" to the noEditFields array based on wether another field has been set. I can't seem to get it working. Can anyone see what the problem might be? Thanks.

 

/custom/modules/Accounts/clients/base/views/record/record.js:

({

    extendsFrom: 'RecordView',

    _renderHtml: function(){
        var pattern = new RegExp("address");
        var idfield = this.model.get('kipid');


        if (typeof idfield !== "undefined ")
        {
            _.each(this.model.fields, function(field) {

                if(pattern.test(field.name)){

                    this.noEditFields.push(field.name);
                }

            });
        }

        this._super('_renderHtml');

    },

    _dispose: function(){
        this._super('_dispose');
    }

})

Outcomes