I’m following up on my initial post regarding a solution to creating a Tabulator cell context menu, which I still have not had any success solving: Setting up Tabulator columnCellContextMenu
Tabulator docs show that cell context menu needs to be defined at column level but I don’t believe Python support that:
columns:[
{title:"Name", field:"name", width:200, contextMenu:cellContextMenu}, //add a context menu to the cells in this column
]
since the cellContextMenu requires a javascript function for action there’s no easy way to do this with the tools available…
You currently have in javascript:
var cellContextMenu = [
{
label:"Cell Context Menu Item",
action:function(e, cell){
alert("cell context item clicked!");
}
}
];
Things like dictionaries, lists, strings, ints, floats are easily converted between python and javascript via the call_js method. But functions… not so much
javascript function --> python is possible
python function --> javascript not possible
So this is the sticking point. If you want an action that is a python function you can’t just do:
Thanks for your response.
I came to the same conclusion about python->js conversion.
What I need is not so much a python function in the context menu, but a way to add the “contextMenu:cellContextMenu” into the column list of dicts; but still the same issue.