Interactive grid "New Button" Add in the Toolber

 


> Go to Interactive Grid

> Go to Attribute

> Go to --> Initialization JavaScript Function:


function(config) {

    let $ = apex.jQuery,

        toolbarData = $.apex.interactiveGrid.copyDefaultToolbar();

    toolbarGroup = toolbarData.toolbarRemove("actions3");


    toolbarData.push(

        {

            groupTogether: false,

            align: "start",

            controls: [

                {

                    type: "BUTTON",

                    action: "saveaction",  //Action Name

                    id: "saveid",

                    label: "Choose Allocation", //Button Name

                    hot: true

                }

            ]

        }

    );

//// FOR OPEN INLINE MODAL REGION ////

 

    config.initActions = function (actions) {

        actions.add({

            name: "saveaction",  //Action Name

            action: function () {

                //let agnCom = $v('P31_ASSIGEN_COMPANY_ID'); 

               // if (agnCom) {

                    apex.region('Show_modal').refresh();

                    openModal('Show_modal'); // Static ID for input modal region

               // } else {

                   // apex.message.alert('At first select Agent Company!');

              //  }

            },

        });

    }

    

    config.toolbarData = toolbarData;

    return config;


}

-----------------------------------------------------------------------

--> Create New Inline Dialog Region (For New form Button)

       --> Template : Inline Dialog

       --> Static Id : Open_Region


==================================

You can set an Apex Item Button in the Toolbar


Go to Execute when Page Loads:

/////////// Button Position/////

var btn = $("#finalAllocBtn").detach();  // BUTTON STATIC ID

$("#detailsid .a-Toolbar-groupContainer--end").prepend(btn); // REGUION STATIC ID


======================================

Hide Grid Edit Button

Go to Execute when Page Loads:

var actions = apex.region('detailsid').call("getActions");
actions.hide("edit");



Post a Comment

Previous Post Next Post