I am trying to hide or disable the "Add Row" button right to the IG (Intractive Grid) when the first row is added in Grid.
Only one record should be available in the IG, so once the first is inserted automatically the "Add Row" Button should be hidden or disabled.
I have tried in Js but it’s hiding the button once the page loads.
function(config) {
var i, toolbarData = apex.jQuery.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions3");
// find and remove the add_row button
for (i = 0; i < toolbarGroup.controls.length; i++ ) {
if ( toolbarGroup.controls[i].action === "selection-add-row" ) //for save and edit it is working
{
toolbarGroup.controls.splice(i,4);
break;
}
}
config.toolbarData = toolbarData;
return config;
}