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

Save contents of the tabs using the button on the tabstrip

1 Answer 41 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.
Hilda
Top achievements
Rank 1
Hilda asked on 10 Feb 2011, 12:03 PM
Hi,

I have two level tabstrip in my application. The first level tabstrip has a save button added during onLoad client event of the tabstrip. The inner tabstrips have forms in each tab. I want to save the contents of these forms(either one by one or together, which ever is feasible) on the click of the save button. Kindly help as soon as possible as it is urgent. 
The pseudo code for the application is as below:

TabStrip 1(Outer tabstrip) :
<% Html.Telerik().TabStrip()
       .Name("TabStrip1")
        
       .Items(tabstrip =>
       {
           tabstrip.Add()
               .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow1").ToString())
               .Encoded(false)
               .Content(() =>
               {
                    
                   Html.RenderAction("Tab1 of Tabstrip1");
                    
               });
           tabstrip.Add()
               .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow2").ToString()).Encoded(false)
               .Content(() =>
                     {
                          
                        Html.RenderAction("Tab2 of Tabstrip1")
                        
                     });
           tabstrip.Add()
               .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow3").ToString()).Encoded(false)
               .Content(() =>
               {
                    
                   Html.RenderAction("Tab3 of Tabstrip1");
                    
               });
           tabstrip.Add()
                 .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow4").ToString()).Encoded(false)
                 .Content(() =>
                     {
 
                         Html.RenderAction("Tab 4");
                          
                     });
           tabstrip.Add()
               .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow5").ToString()).Encoded(false)
               .Content(() =>
               {
                    
               });
           tabstrip.Add()
               .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow6").ToString()).Encoded(false)
               .Content(() =>
               {
                    
               });
           tabstrip.Add()
                .Text(GetGlobalResourceObject("Localization", "label_MainWorkFlow7").ToString()).Encoded(false)
                .Content(() =>
                      {
                           
                      });
                  
       })
       .SelectedIndex(0)
       .ClientEvents(events =>
           events
           .OnLoad("onLoad")
           )
       .HtmlAttributes(new { @class = "MainWorkflow" })
       .Render();   
        %>
    </div>
     
     <script type="text/javascript">
         function onLoad(e) {
             $('#TabStrip1').prepend('<input type="submit" value="Save" id="Save" style="float: right;clear:both" class="Button" title="Save" />');
         }
             
    </script>

In the page Tab4

TabStrip 2 ( inner tabstrip containing tabs with the forms for collecting data put in different pages)

<% Html.Telerik().TabStrip()
            .Name("TabStrip2")
            .Items(tabstrip2 =>
            {
                tabstrip2.Add()
               .Text(GetGlobalResourceObject("Localization", "label_SubWorkFlow4_1").ToString())
               .Content(() =>
               {
                    Html.RenderAction("Tab1 of Tabstrip2");
                    
                 
                });
                tabstrip2.Add()
               .Text(GetGlobalResourceObject("Localization", "label_SubWorkFlow4_2").ToString())
               .Content(() =>
               {
                   Html.RenderAction("Tab2 of Tabstrip2");
                 
                });
 
...
                })
                .ClientEvents(events => events
                        .OnSelect("onSelect")
                )
              .SelectedIndex(0)
               .HtmlAttributes(new { style = "font-size: 0.80em;" })
               .Render(); 
                  %>

And pages Tab1 of Tabstrip2 and Tab2 of Tabstrip2 have one form each whose value needs to be saved.

Thanks in advance

Regards,
Hilda Fabiola Bernard

1 Answer, 1 is accepted

Sort by
0
Hilda
Top achievements
Rank 1
answered on 15 Mar 2011, 09:52 AM
Solved it by using form.serializeArray() to get all the values from the form in the onClick function of the button.
Tags
TabStrip
Asked by
Hilda
Top achievements
Rank 1
Answers by
Hilda
Top achievements
Rank 1
Share this question
or