change sidebar submenu values dynamically

Hi,
how can I change the label/value of a submenu item in a sidebar view dynamically?
$$(‘mySideBar’).parse(new_array_data) does not update the new values
I need to change the icon & the value in base of the status of a submenu item:

from:
{ id: “active_autoplace_id”, value: "  Value 01"}

to:
{ id: “active_autoplace_id”, value: "  Value 02"}

and viceversa after the click on the item: “onAfterSelect” event

many thanks & Regards

Hello @Angelino1990 ,
In your case, the most correct way to change data to use updateItem method. It changes the data and immediately redraws with the new values.
Please check the following snippet:
https://snippet.webix.com/rbv9wuie

Dear Anna,
unfortunately the updateItem method has no effect if the sidebar is in collapsed:true state.
Please check:
https://snippet.webix.com/hf9mebiw

Hello,
The sidebar is a static menu (which should not be updated as a date component).
By structure, it consists of two independent parts (tree + popup menu). The data between which is synchronized when the menu is opened and should receive new nested elements (that is, reopening the menu, on the same item, will not cause a reload of the nested data).
There is no immediate connection between these two parts. To solve the problem you can use onAfterSelect event, get popup menu and call updateItem method with checking.

$$("menu").getPopup().queryView({view:"menu"});

Please note that icons don’t appear in the popup menu, so it will not be visible in collapsed mode - it’s normal behavior.
If you want to draw icons in popup menu, you need to edit the template:
https://snippet.webix.com/uau9daw6

Hi Anna,
unfortunately the proposed solution does not persist.
The menu item now gets updated to “changed” with your statement sub.updateItem(), but if the user clicks away and the popup menu disappears, the item returns back to its original value.
Is there a way to persist this change?

Thank you