Hello!
I want to have a possibility to show contextmenu on datatable body even it has no data. But if context menu has been shown on area with data I need to get ID of data item on which contextmenu was shown.
How to get datatable item ID if contextmenu was attached to datatable body node?
For instance:
const tableBody = this.table.getNode().querySelector('.webix_ss_body');
const contextMenu = webix.ui({
view: "contextmenu",
data: ['Get info', 'Delete item'],
on: {...},
});
contextMenu.attachTo(tablebody);
In this case I cant’ use context.id
property:
const context = contextMenu.getContext();
const event = this.table.getItem(context.id);
I just want to set arbitrary content of contextmenu depend on area of datatabel. If it has data, contextmenu has to have some buttons usings data information, if it’s an empty area another buttons.
How to manage this task?