webix.UIManager.getState/setState for tabbbar in tabview ui

I’m using webix.UIManager.setState for tabbbar but there are also onBeforeTabClick and onAfterTabClick events on my tabs which reload some data in form and tables when changing my tabs.
How can I trigger onTabclick /onBeforeTabClick in my setState because of changing tab?

And how can I trigger a onBeforeTabClick and onAfterTabClick programmaticaly ?
From getState I get all positions an active Tab is called with activeCell but to find out that takes to long time… :-/

Is there some solution?

Thanks a lot
Michael

try to listen to onChange event instead on onAfterTabClick

Thank you integral that helps a bit.

But does onBeforeTabClick also trigger? And how can I trigger a tabbar on Click event? And when I call webix.UIManager.setState(state); what would be the best way to get tab id from out of state?

Thank you for your help
Michael

if you want to get current tab id after setState, use getValue method.
to trigger onAfterTabClick event, use callEvent method

webix.UIManager.setState(tabBarState);
var tabId = $$("tabbar").getValue();
$$("tabbar").callEvent("onAfterTabClick", [tabId]);

but in the original event there is also native event as second argument. so be aware of its absence in case of synthetic trigger.

Hello thank you integral. I’ll check it out…