Did anyone ever succesfully extend the MultiAttachmentsField controller?

Hi, 

I was wondering if anyone succesfully extended the MultiAttachmentsField Controller? I need to make a small change to the format function so the url that is generated is a bit different for some reason as soon as I make a new file custom/modules/Notes/clients/base/fields/multi-attachments/multi-attachments.js and add the following content the field seems to be broken?

({
    extendsFrom: 'BaseMultiAttachmentsField',

    format: function (value) {
        return this.super("format",value);
    }
})

even if I add the contructor to it with this.super('initialize',[options]) in it, it doesnt seem to be working. Any idea's on how to extend it correctly?

Parents
  • For those who are also strugling with this. I got it working by adding a controller to custom/modules/Notes/clients/base/fields/multi-attachments. This controller should extend the BaseNotesMultiAttachmentsField instead of the default like to so:

    ({
        /**
         * Override multi-attachments field for notes
         */
        extendsFrom: 'BaseNotesMultiAttachmentsField',
    
    
        init: false,
    
        initialize: function(options){
            // your custom initialize code here   
        }
        
        // your custom code here..
        
    })

Reply
  • For those who are also strugling with this. I got it working by adding a controller to custom/modules/Notes/clients/base/fields/multi-attachments. This controller should extend the BaseNotesMultiAttachmentsField instead of the default like to so:

    ({
        /**
         * Override multi-attachments field for notes
         */
        extendsFrom: 'BaseNotesMultiAttachmentsField',
    
    
        init: false,
    
        initialize: function(options){
            // your custom initialize code here   
        }
        
        // your custom code here..
        
    })

Children
No Data