Answers ( 1 )

  1. 2017-01-04 06:01

    This bit of JavaScript will be called on press of the GridField save button.

    (function($) {
        $.entwine('ss', function($){
            $('#Form_ItemEditForm_action_doSave').entwine({
                onclick: function(e) {
                    console.log('Hello there');
                    this._super(e);
                }
            });
        });
    })(jQuery);
    

    In SilverStripe 3.5 the default ID for the GridField save button is Form_ItemEditForm_action_doSave. If using the BetterButtons module the save button ID is Form_ItemEditForm_action_save.

◀ Go back