Skip to main content
Nintex Community Menu Bar
Question

How to print time when a tabs DOM elements are rendered?

  • July 10, 2024
  • 3 replies
  • 14 views

Forum|alt.badge.img+4

On tab click I’m rendering page using “page include” component, I want to print time once the page load completed,  I’m using below function (inline js), but it’s printing time before rendering the page.

(function(skuid){
var $ = skuid.$;
   $(function(){
      $(‘body’).on(‘tabshow’,function(event){
          console.log(new Date().toLocaleString());
      });
   });
})(skuid);

This topic has been closed for replies.

3 replies

Forum|alt.badge.img+13

If your logic is Tab-specific, the preferred approach is to use Tab “When First Shown” Actions, where you can define a sequence to Actions to run whenever that Tab is first shown. That series of actions can include running a Snippet. Or if you want to have the logic run whenever a particular Tab is selected, you can use “Whenever Shown” Actions.

0c35ad8ec6ba3992c805704307b1089e4dbca497.png



Forum|alt.badge.img+13

Also, you should never use $(function() { syntax within a Skuid Page, always use the following syntax instead to wait until the Skuid page has finished loading:

$("&#46;nx-page")&#46;one("pageload", function() {<br /> $('body')&#46;on('tabshow',function(event){<br />&nbsp; &nbsp; &nbsp; console&#46;log(new Date()&#46;toLocaleString());<br />&nbsp; &nbsp;});<br />});

Forum|alt.badge.img+4

Thanks for your quick reply, I want print time once the page (child) which I’m loading the page using by “includepage” component. 

Example: I’m using tabset component which have 4 tab items. Each tab item loading different pages using pageinclude component.