1

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;

}
Laurel
  • 5,965
  • 14
  • 31
  • 57
Abinnaya
  • 203
  • 4
  • 26
  • @Laurel would be grateful if you can reply with resolution on this https://stackoverflow.com/questions/64903319/why-picklist-not-populating-data-for-custom-dependent-picklist-field-with-lightn – Carolyn Cordeiro Nov 19 '20 at 00:10

1 Answers1

0

Looks like a vary complicated procedure for a simple task possible solutions:

  1. If all you need is adding one row - use a form instead of IG
  2. Initiate the region with one empty line, and remove the "Add row" button all in all
  3. Use a dynamic action which is triggered by the Add row button that disables the same button