Is there a way to modify the logic of the "save" action of the SAVE button on an Interactive Grid ?
I want to add some logic before the save action is triggered.
I tried adding a new SAVE custom button that do the job but I want to reuse the current SAVE button instead of creating a new one.
This is the logic I'm using to create my new button:
function(config) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions2"); // this is the group with the actions menu
// add a custom save button after the actions menu
toolbarGroup.controls.push( {
type: "BUTTON",
action: "custom-save",
iconBeforeLabel: true,
hot: true
});
config.toolbarData = toolbarData;
config.initActions = function( actions ) {
actions.add( {
name: "custom-save",
label: "Save",
action: function(event, focusElement) {
customSaveAction();
}
} );
actions.hide("save");
}
return config;
}