Custom MenuItem
What is Custom MenuItem?
Widget's right click menu support add custom menuitem. you can create "menu" node in "widget.json" file to create custom menuitem. Custom MenuItem can bind measure to send command to measure or run javascript code.
Measures are also can auto create custom menuitem by default. if you do not need custom menuitem by measure ,just add this code in measure section "autoCreateCustomMenu" : false
Sample
How to Create MenuItem
Found the "menu" json node in file "widget.json",if not, you need create a json node named "menu" for excample :
Add MenuItems into the menu json node like this:
MenuItem Property
caption : MenuItem title
measure: the measure name of bind
onClick: when the menuitem clicked,the command of the bind measure will be invoked
isChecked : the menuitem will be checked when the value is true
enabled: the menuitem will be gray and can not click when the value is false
How to Display Measure Setting Window by MenuItem
Measure setting menuitem is auto created by default, you can disable it by "autoCreateCustomMenu".
You also can create measure menuitem by set the menuitem measure field with the measure name , and set the onClick field with "setting",for excample:
You can found all the measure command from here
How to Run JavaScript Code
You can run javascript code when the menuitem was clicked by set the measure to blank and set the js code into the onClick property. It can execute multiple js statements at the same time.
Last updated