jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Tabs › Tab Contents refresh
This topic contains 4 replies, has 2 voices, and was last updated by DavidSimmons 12 years, 5 months ago.
-
AuthorTab Contents refresh Posts
-
Is there a way to refresh a Tab’s content (what ever is in the tab) on Tab Click or Select….
Sorry I thought this might make it clearer. I have a jqxGrid in each of the Tabs, so if I could get the jqxgrid instance name on a tab click then I could do something like this….
$(‘#jqxTabs’).bind(‘tabclick’, function (event) {
displayEvent(event);
var jqxgridName = **** Tab’s Content Div Name or instance name *****$(jqxgridName).jqxGrid(‘updatebounddata’);
});
New Bid
Bid Prep
Review
Complete
JFUIn the following example, when you click on the tab, I need to perform a $(jqxgridName).jqxGrid(‘updatebounddata’); for the clicked tab’s content or jqxgrid. I think if I could get the tab’s content div id name back on a tab click event I could do this but not sure how.
I would appreciate any help?
BidsNew Bid
Bid Prep
Review
Complete
JFUHi David,
When you add the HTML of the jqxTabs, you can set IDs of the jqxTabs DIV tags, like id=”tabContent1″, id=”tabContent2″, etc. Then subscribe to the ‘tabclick’ event and get the tab’s index in the event handler:
$('#jqxTabs').on('tabclick', function (event) { var clickedItem = event.args.item; });
To get the tab’s content, use a simple jQuery selection:
var content = $(“#tabContent” + clickedItem);
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comNot sure I understand your example… Here is my workaround, but I would rather get the content -> div -> id -> names dynamically. Are we talking about the same thing?
$(“#jqxTabs”).on(“tabclick”, function (event) {
var item = event.args.item;
var title = $(“#jqxTabs”).jqxTabs(“getTitleAt”, item);
if(title===”New Bid”){
$(“#jqxgridNew”).jqxGrid(‘updatebounddata’);
}else if(title===”Bid Prep”){
$(“#jqxgridPrep”).jqxGrid(‘updatebounddata’);
}else if(title===”Review”){
$(“#jqxgridReview”).jqxGrid(‘updatebounddata’);
}else if(title===”Complete”){
$(“#jqxgridComplete”).jqxGrid(‘updatebounddata’);
}else if(title===”JFU”){
$(“#jqxgridJFU”).jqxGrid(‘updatebounddata’);
}
});New Bid
Bid Prep
Review
Complete
JFU -
AuthorPosts
You must be logged in to reply to this topic.