This is a migrated thread and some comments may be shown as answers.

[Solved] Post in TabsStrip

1 Answer 78 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Abdulmenan
Top achievements
Rank 1
Abdulmenan asked on 31 Dec 2009, 01:53 PM
I am in situation where I need to use multiple tabs, each tab being a partial page and each one having  a post. what I need is, when a post occurs from the second tab, I want to make second tab selected when I render back form the post.

Thanks
Abdul




1 Answer, 1 is accepted

Sort by
0
Accepted
Joshua Holt
Top achievements
Rank 2
answered on 13 Jan 2010, 06:07 PM
Hi Abdul,
The best thing idea i would have for this, is to have jQuery hande the post, and in the callback method of the post call:
 
function ShowTab(idx){       
      var tabstrip = $("#TabStrip").data("tTabStrip"); //Change "TabStrip" for the name of your tab strip     
      var item = $("li", tabstrip.element)[idx)];      
      tabstrip.select(item);     
}   
Example:

function DoPost(){                      
     $.post("somePostURL"//Put your post url here                  
     { arg1: "post", arg2:"data" },  //Load your post vars here               
      function(data){                       
                        ShowTab(2);                      
                    },                   
     "json");     
}      
 
function ShowTab(idx){       
     var tabstrip = $("#TabStrip").data("tTabStrip"); //Change "TabStrip" for the name of your tab strip      
     var item = $("li", tabstrip.element)[idx)];       
     tabstrip.select(item);    
 }   






Call the DoPost method from a click handler attached to your submit/save button. ( add your post args here too)

JQuery Post - Info about jQuery post
TabStrip Client API - Info about the TabStrips client API.

-Josh
Tags
TabStrip
Asked by
Abdulmenan
Top achievements
Rank 1
Answers by
Joshua Holt
Top achievements
Rank 2
Share this question
or