Jump to content


Photo

jqueri ui tab help


  • Please log in to reply
1 reply to this topic

#1 sasori

sasori
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 20 April 2017 - 03:24 PM

which event to use to get the properties,ids,elements of the first  tab in ui jquery?

so the situation is like this:

 

I pop out a jquery dialog box when I click a row from a grid view in the main page.

inside that dialog box, I have a jquery ui tabs. I was able t o get the properties by using

the 'activate' event in this jquery ui tab like this

 

$('#tabs').tabs({
 activate : function(event,ui){
 alert(ui.newPanel.find(".row #button").attr("id"));}
}); 

 

that snippet works if I click the other tabs. but the problem now is,

once the dialog box pops out. I am not able to get the properties inside 

the first tab which is by default selected in jquery. I am only able 

to use that snippet to the succeeding tabs , it will only work in the

first tab after I click the other tabs. any idea to solve this problem?

i'm more of a backend dev...it takes me hours to build an application that

has a front-end coding involve 



#2 denno020

denno020
  • Members
  • PipPipPip
  • Advanced Member
  • 736 posts
  • LocationAustralia

Posted 18 May 2017 - 04:27 AM

Do you want the tab that is selected?

 

You can always do something like this:

$(".ui-tabs-container").find("li.active")

Which will give you the actual tab.

 

If you want the tab content that is currently selected then you could read the 'aria-controls' attribute of the selected tab, which will correspond to the ID of the tabs content container

var tabId = $(".ui-tabs-container").find("li.active").attr('aria-controls');
var tabContent = $("#"+tabId);

Pretty sure that will work, but not 100% sure what you want






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users