AnsweredAssumed Answered

How to have a custom button call a URL?

Question asked by Steve Cox on Oct 27, 2014
Latest reply on Oct 28, 2014 by Steve Cox
Hi,

I've created a custom sidecar button - by extending RowactionField in a custom field.

The button renders fine but I'd like to have it call a remote URL. The URL will download a file, so just having it open in a separate browser window will be fine. However, I'm not sure how to achieve this using sidecar. Can anyone point me in the right direction?

custom\clients\base\fields\statsaction\statsaction.js:


({
    extendsFrom: 'RowactionField',

    initialize: function(options) {
        app.view.invokeParent(this, {type: 'field', name: 'rowaction'
         , method: 'initialize', args: [options]});
        this.type = 'rowaction';
    },


    /**
     * {@inheritDoc}
     * @private
     */
    _render: function() {
        if (this.model.get('mm_accounts_customersysid_field_c') == '') {
            this.hide();
        } else {
            this._super('_render');
        }
    },
    /**
     * Triggers event provided at this.def.event on the view's context object by default.
     * Can be configured to trigger events on 'view' itself or the view's 'layout'.fields
     * @param evt
     */
    rowActionSelect: function() {
        if(this.isDisabled()){
            return;
        }
        //CODE HERE?

    },

});

Outcomes