addNewChild in menu does not appear to work

I have a menu set to dynamic loading and I want to add child items to one of the items in the menu. This item is not set with ‘complex’ attribute. However no child items show up.

Please can you tell me what I’m doing wrong.

Thanks

Menu was not designed to use script methods for adding items when dynamic loading enabled.
However, you may use the following workaround:

menu.addNewChild(itemId, position, text);
menu.itemPull[menu.idPrefix+itemId].loaded=“yes”; /set loaded state for an item/

Here is the modified dhtmlxmenu.js that allows to avoid setting loaded attribute.
dhtmlxmenu.zip (17.4 KB)

Thank you for your prompt attention as always. Much appreciated.