Jump to content

jqueri ui tab help


sasori

Recommended Posts

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 

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.