If specify the name of the popup menu registered as GridBase.registerPopupMenu in DataColumn.popupMenu property, the registered popup menu will be displayed when click the menu button displayed in the data cell with mouse over. In order to display the column popup menu, you should register the menu as in the code below first.
If would like to display a separate menu depending on the data row, you can use popupMenuCallback. Please refer to "Currency" column settings.
grid.registerPopupMenu('menu01', [{
label: 'menu1',
callback: menuCallback
}, {
label: 'menu2',
}, ...
]);
Please refer to Menu Overview help about how to define the menu.
In the grid above, the popup menu has been specified in "Country" and "Interest Rate" columns. First, you should specify DataColumn.button property as "popup". And then, specify the name of the popup menu registered above in popupMenu.
A button will be displayed in the data cell of the corresponding column once the popup menu is specified, and it will be specified in buttonVisibility property. "Country" column has been specified through ButtonVisibility.ALWAYS and "Interest Rate" column has been specified through DEFAULT as a default value.
Please change buttonVisibility of "Interest Rate" column.
If set visible, it will display the button only in Focused Cell.
grid.setColumns([{
...
}, {
"name": "Country",
"fieldName": "country",
"button": "popup",
"popupMenu": "menu01",
"buttonVisibility": DataLudi.ButtonVisibility.ALWAYS
}, {
"name": "Country",
"fieldName": "country",
"button": "popup",
"popupMenu": "menu02"
}, ...
]);