Skip to main content

I thought that ‘tabshow’ was now running anytime a tab was shown, including pageload (see https://community.skuid.com/t/run-code-when-tab-loads), but it doesn’t seem to be, unless I’m doing something wrong.

I made a comment on that thread, but it’s so buried I thought it best to start a new one.

I have this code in-line:


$(document.body).one('pageload',function() { <br>// Set tabshow function<br>$(tabSet).on('tabshow',function(event, data){<br>console.log(event);<br>console.log(data);<br>});<br>});


But I get nothing in the console.



From my experience, the tabshow event is NOT fired on page load. This resulted in having duplicate code in the page load and on the tabshow. 

If there is a better way, i’d love to know.


With the introduction of Tab actions - why do you need to go to code for actions taken at tab show?   I’ve had good success with firing a set of actions on tab load after page load.  It gives the user some temporary page components, and then fires the actions to load the models in the tab…

Nice. 


Rob, Are there tabshow actions at the tabset level? I wasn’t aware of that. I’d like to avoid setting up the same set of actions for every tab.


Rob,

I check the tabset parameters, but there are no actions that can be applied to all tabshow events for the tabset. That’s why I was working in javascript. I need the same behavior for every tab for large tabsets across multiple pages. Definitely not interested in setting up the same set of actions for each tab panel (unless you give us the reusable custom action sets that Barry has been pushing for, ideally available universally across pages).

So, I suppose I have to duplicate the code for pageload.


Yep.  All that makes sense.  All of it…