From edca7a7a62fe43080c3a6c8adfab892bb80fc2ab Mon Sep 17 00:00:00 2001 From: RobAley Date: Mon, 25 Feb 2019 16:05:54 +0000 Subject: [PATCH] update oncreatemenu to change path to object --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 42b410a..b03e5f0 100644 --- a/docs/api.md +++ b/docs/api.md @@ -146,11 +146,11 @@ Constructs a new JSONEditor. See also option `schema` for JSON schema validation. -- `{function} onCreateMenu(items,path)` +- `{function} onCreateMenu(items,{path})` Customize context menus in tree mode. - Sets a callback function to customize the context menu in tree mode. Each time the user clicks on the context menu button, an array of menu items is created. If this callback is set, the array is passed to this function along with the current path (if any). This function can customize any aspect of these menu items, including deleting them and/or adding new items. Each menu item is represented by an object, which may also contain a submenu array of items. See the source code of example 21 in the examples folder for more info on the format of the items and submenu objects. + Sets a callback function to customize the context menu in tree mode. Each time the user clicks on the context menu button, an array of menu items is created. If this callback is set, the array is passed to this function along with an object containing the current path (if any). This function can customize any aspect of these menu items, including deleting them and/or adding new items. Each menu item is represented by an object, which may also contain a submenu array of items. See the source code of example 21 in the examples folder for more info on the format of the items and submenu objects. The function should return the final array of menu items to be displayed to the user.