onTabClick event is triggered with tabbar.loadXML


tabbar.loadXML('xml/tabbar-items.xml?etc=' + etc, function() {
    // tabbar loaded
tabbar.attachEvent('onTabClick', function(id, last_id) {
    // tab clicked

I have discovered that onTabClick is triggered with tabbar.loadXML() call. Is it an expected behavior? If yes, I suggest to update the description of the onTabClick event which states:

occurs when the user clicks on the tab



Event “onTabClick” can be triggered in the next cases:

  1. by tab selection (i.e. you can have selected=“1” in your xml structure)
  2. by click on already selected tab
  3. by changing of selected tab

You can try to set this event after XML load in callback - your defaule selection will not call this event.
About documentation - we will add some specifications.

Darya, now it’s clear. Thanks.

You are welcome!