EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: JPi on November 03, 2016, 12:40:47 AM



Title: How to know the last visited tab
Post by: JPi on November 03, 2016, 12:40:47 AM
Hi,

I have 4 tabs on my main screen say A,B,C,D. I need to perform some action if the last visited tab was C. So what is the code to check and perform some logic if last visited tab is C prior to navigating to the current selected tab of user.

Thanks,
JPi


Title: Re: How to know the last visited tab
Post by: stworthy on November 03, 2016, 07:03:52 AM
When a tab panel is selected, the 'onSelect' event fires.
Code:
$('#tt').tabs({
  onSelect: function(title,index){
    // detect if the selected tab panel is what you want
    if (...){
      // do something here
    }
  }
});