Attach onload event handler for each tab in Record Details - Tab View Page (Available starting 4.2 release) 


rb.newui.util.addEventListener('rbs_initialTabRender', onTabLoad); 

For Record View/Details page which has Tab’s enabled, all tabs are not loaded at the same time but instead every tab except for the default one is Ajax loaded on first selection. If user sets ‘Do not use Ajax for tabs’, even then all tabs may not be loaded immediately but in an async manner.

Hence, for such pages, we have a different event fired when each page tab is loaded i.e. rb.newui.util.customEvents.rbs_initialTabRender. 

Users should add handlers for this event instead of the more generic rb.newui.util.customEvents.rbs_pageRender, if they intend to do tab specific customizations once a tab has been rendered.

Eg: 

//add a handler which will be notified on load of each tab 

rb.newui.util.addEventListener('rbs_initialTabRender', onTabLoad);

function onTabLoad(event, eventData) {

  if (eventData.index === 0) { //handler for first tab only

    var tabContentEl = eventData.contentEl; //tab content element.

    //custom code follows…

   console.log(“Tab “+eventData.index+” has loaded”);

  }

}