I have a series of methods available in a dropdown menu (created with plugins.window.createPopupMenu()). For one of these methods I would ideally like to pass a parameter with it. As you know the syntax for ".addMenuItem" though just allows for passing the name of the method (without the parentheses following the name) as otherwise it would execute when the dropdown itself is activated. I can't see any way to pass a parameter to the method but does anyone know any way of doing that?
var popupMenu = plugins.window.createPopupMenu(); var menuItem = popupMenu.addMenuItem('aName', aMethod); menuItem.methodArguments = [1, true, 'whatever'];
Note that the array elements will be passed as arguments 5, 6 and so on to the callback method.
Patrick Talbot Freelance - Open Source - Servoy Valued Professional https://www.servoyforge.net Velocity rules! If you don't use it, you don't know what you're missing!
Thanks so much Patrick. I missed that somehow. But with your pointer I just clicked on MenuItem and then the property of methodArguments in the documentation... Somehow I was thinking the argument construction would simply show in addMenuItem.