Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interactive Grid Customization

user-1u1pnSep 5 2023 — edited Sep 5 2023

I have created interactive grid with pop up menu item in it.

Code for this

function(config) {
   var $ = apex.jQuery,
   toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),  // Make a copy of the default toolbar
   toolbarGroup = toolbarData.toolbarRemove("search");         // Remove the search menu group
   toolbarGroup = toolbarData.toolbarRemove("reports");        // Remove the reports menu group
   toolbarGroup = toolbarData.toolbarRemove("views");          // Remove the views menu group
   toolbarGroup = toolbarData.toolbarRemove("actions2");       // Remove the actions2 menu group
   toolbarGroup = toolbarData.toolbarRemove("actions3");       // Remove the actions3 menu group
   toolbarGroup = toolbarData.toolbarRemove("actions4");       // Remove the actions4 menu group
   toolbarGroup = toolbarData.toolbarFind("actions1");         // Locate the actions menu group  
   // Add new buttons
   // Note the toolbar is action driven, so we just need to define the correct action name with the button.
   
   // Add a Menu to the toolbar
   toolbarGroup.controls.push({type: "MENU",
       id: "my-menu",
       label: "Action",
      
       iconBeforeLabel: true,
       hot: true,
       action: "custom-menu",
       // Add Menu Items (each additional entry needs a separator)
       menu: {
           items: [
          
           {
               type: "action",
             
               label: "p1"
              
           }, {
               type: "separator"
           }, {
               type: "action",                
               label: "p2"
              
           },
           {
               type: "separator"
           },
           {
               type: "action",                
               label: "p3"
            
           }
           
           ]
       }
   });
  
   // Assign new toolbar data back to toolbarData configuration property
   config.toolbarData = toolbarData;
   // Return the options
   return config;
}

So, next I need to hide the menu item with label “p2”, when a button is clicked.

How to access the menu item from button's dynamic action and can you provide me the JavaScript code for this.

Thank you!

Comments
Post Details