Page tree
Skip to end of metadata
Go to start of metadata

The developer can specify the Grid 'contextMenu' attribute that will be contain the Menu Structure name.


This Menu Structure will be loaded as the Grid object context menu: When hovering over a Grid row the three dots will show up to open the Context Menu.


When opening the Context Menu, the Menu items will be displayed. Also the visibility of the Menu items can be adjusted in a custom grid event, "onGridContextMenuOpen",

by specifying a custom method.


For example:

onGridContextMenuOpen = "$ akioma.test.grid.onContextMenuOpen(eventSource); "


Inside the custom client logic method, logic can be written to show/hide different context menu items:

namespace akioma.test.grid{

    export function onContextMenuOpen (eventSource: akioma.swat.Grid) {
        
        const name = eventSource.dataSource.getValue('name');

        if(name.startsWith("John")) {
            eventSource.hideContextMenuItems(); // hide all context menu items
        } else if(name.startsWith("offer")) {
            eventSource.hideContextMenuItem("OpenOffer"); // hide a given context menu item
        }
    
    }
}



Methods that can be used on the Grid object to show/hide individual or all context menu items.


Grid.hideContextMenuItem("CodeA");??// hides a given context menu item

Grid.showContextMenuItem("CodeB");????// show the given context menu item

Grid.showContextMenuItems();??// show all context menu items

Grid.hideContextMenuItems();??// hide all context menu items





  • No labels