Search code examples
oracle-apexoracle-apex-5.1oracle-apex-5

Rename "Add Row" on Apex IG


I need to rename the add row button to something else on my apex app. This has to be specific to a page not an app wide change. I tried below code, but it doesn't seem to work.

function( config ) {

config.initActions = function( actions ) {

 // actions.lookup( "add row" ).label = "Add Student";   // i tried this as well

   

    actions.lookup( "Add Row" ).labelKey = "MY_TEXT"; 

}

return config;

}


Solution

  • Use the following javascript in Interactive Grid Region > Attributes > Javascript initialization Code:

    function(config) {
        let $ = apex.jQuery,
            toolbarData = $.apex.interactiveGrid.copyDefaultToolbar();
            addrowAction = toolbarData.toolbarFind("selection-add-row"),
            addrowAction.label = "Renamed Add Row"; // Pick name you need
        config.toolbarData = toolbarData;
        return config;
    }
    

    There are many blogs on this. Best place to start is the blog by John Snyders and the IG Interactive Cookbook (link is in one of the blogs by John Snyders)