0
votes

I have an Interactive Grid on my page and I want to add a button to a toolbar. I have wrote a javascript function and tried to add the code under Advanced->Javascript. But when I did that my grid content disappeared completely, only heading was left. Is that the wrong place to add my code? How to ensure the function gets called?

Below is my function:

function(config) {
    var $ = apex.jQuery,
    toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
    toolbarGroup = toolbarData.toolbarFind("actions3"); // group where Add Row button is

    toolbarGroup.controls.push({type: "BUTTON",
                            action: "selection-delete"
                           });

    config.toolbarData = toolbarData;
    return config;
}
2
Could you check if is there any error on console? I try this code here and works.romeuBraga
I replicate this problem on a master detail interactive grid. If I put this code only on detail, the grid report disappeared, if put on both, works. i do not know why this happen.romeuBraga
@romeuBraga, I am new to APEX. How do i check the console?Coding Duchess
On chrome, F12 >> console.romeuBraga
thank you! got an error " toolbarData.toolbarFind not a function"Coding Duchess

2 Answers

0
votes

I do not know why, but this problem occurs when you use this code in a detail of an interactive grid.

The problem is solved when you put the code in both the reports, the master and the detail.

0
votes

The problem is that the function "toolbarFind" is deprecated or just removed in current version. Try:

toolbarGroup = toolbarData[toolbarData.length-2];