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?

Fullscreen
1
2
3
4
5
6
7
({
extendsFrom: 'BaseMultiAttachmentsField',
format: function (value) {
return this.super("format",value);
}
})
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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?

  • 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:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    ({
    /**
    * Override multi-attachments field for notes
    */
    extendsFrom: 'BaseNotesMultiAttachmentsField',
    init: false,
    initialize: function(options){
    // your custom initialize code here
    }
    // your custom code here..
    })
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX