TMenu is used for context menus. Each TMenuItem is Name(label),
Value(action), and Values(action params).
Process Flow
- JavaScript calls server for menu (async_get_table_context_menu) and a TMenu is returned.
- JavaScript shows the menu
- When item is selected, the Value (ie action), is first resolved to be a JavaScript method.
- If method is found, then the method is invoked, and the lifecycle is complete
- If method is not found, then the server handler(on_handle_context_menu_item) is called passing the Value and Values.
- From here you can do any server operations and return a Json response.
-- The Json response can be anything you want, including a standard ReplyBuilder object with Changes and Deletes
- When JavaScript recieves the reply it will call "Value"Reply(reply) method in JavaScript. (where "Value" is the action name)
- If no method "Value"Reply exists, but the reply is a ReplyBuilder reply, then the Changes are passed directly to TreeGrid