javascriptoracle-apexinteractive-grid

Change label of Interactive Grid button without creating whole new button


I am a little stuck on working with javascript in Interactive Grid in Oracle Apex. I just want to change the label of one interactive Grid save button, but I am not able to do it. I don't want to create a custom button, because then it won't detect when i mark a checkbox. I am on APEX 23.2 It shouldn't be too hard to change the label of a button right?

This code is not working

function(config) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),  // Make a copy of the default toolbar
toolbarGroup = toolbarData.toolbarRemove("actions2");       // Remove the actions2 menu group

toolbarGroup.controls.push({
    type: "BUTTON",
    label: "test",
    action: "save",
    icon: "icon-ig-save",
    iconBeforeLabel: true,
    hot: true
});

// Assign new toolbar data back to toolbarData configuration property
config.toolbarData = toolbarData;

// Return the options
return config;

}


Solution

  • Try this:

    function(config) {
        let $ = apex.jQuery,
            toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
            saveAction = toolbarData.toolbarFind("save");
            saveAction.label = "test";
            config.toolbarData = toolbarData;
        return config;
    }