I don't have lot of experience with web .. and i need to do something on web client.
I have some code that someone wrote in reactjs - and i want to popup menu when the user click on right click.
I wrote function that call on the right click event ( stop on this event on the right click ) and on this function i create (dynamicly) the menu.
Now i try to add this menu to the dom-> body and i don't know how to do it.
I also don't know how to add the position of the menu.
The code:
// the func event that call on right click
popupMenuOnRightClick(position){
// create the manu
var menu = [
{
name: 'item1'
title: 'itemTitle1',
func: function()
{
alert('I am itemTitle1')
}
},
{
name: 'item2'
title: 'itemTitle2',
func: function()
{
alert('I am itemTitle2')
}
}
];
document.body.appendChild(menu);
}
My code is nead to be popup from the react code file ( jsx file ).