Is there an event when a tabs DOM elements are rendered?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I need to execute some jQuery on some DOM elements inside a tab.  I've tried doing this on the 'pageload' event, but that doesn't fire when you click on a tab (and the DOM elements within the tab don't render until you do the first click).  Is there another event I can use to be notified when the tab is rendered?  Is there any documentation on the events that are available (other than the few on the model in the developers guide)?

Thanks!

- Chris
Photo of Chris

Chris

  • 1,632 Points 1k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
function(skuid){   
   var $ = skuid.$;
   $(function(){
      $('body').on('tabshow',function(event){
          var tabShown = $(event.target);
          var tabId = tabShown.attr('id');
          console.log(tabId);
      });
   });
})(skuid);

https://community.skuidify.com/skuid/topics/run_code_when_tab_loads
(Edited)
Photo of Chris

Chris

  • 1,632 Points 1k badge 2x thumb
Sweet!   Thanks so much - works perfect.