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

TabStrip reload data

3 Answers 1198 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
InQuera LTD
Top achievements
Rank 1
InQuera LTD asked on 14 Oct 2013, 01:41 PM
Hi ..
I have Master details datageid, in the row details i have tabstrip as partial view i'm loading each tabitem data with 
.LoadContentFrom("Action", "controller", new { Action parameters  });
i have listbox with the tabs names and in  the Change event i select the tabitem

everything work fine and the data loaded well, the problem is if i update the data and trying  to load the data in the details
can not  see the changes , looks like the data is in the cash
here is the details  code  : 

   @(Html.Kendo().DropDownList()
                  .Name("cmbCaseDetails_" + Model.CaseID)
                  .DataTextField("Text")
                  .DataValueField("Value")
                  .BindTo(new List<SelectListItem>() {
                          new SelectListItem() {
                            Text = "Fields", Value = "0" 
                          },
                          new SelectListItem() {
                            Text = "Descriptions", Value = "1"
                          },
                         new SelectListItem() {
                            Text = Relations", Value = "2"
                          }
                 })
                 .SelectedIndex(0)
                 .Events(e => e.Change("onDetailsListChanged"))
        )
       


 @(Html.Kendo().TabStrip()

                    .Name("tabDetails_" + Model.CaseID)
                  .HtmlAttributes(new { style = "background-color:#FFFFFF;border-style:none;" })
                  .Animation(animation => { animation.Enable(false); })
                  .Items(tabCaseDetails =>
                  {
                        tabCaseDetails.Add().Text("Fields")
                          .LoadContentFrom("CaseFields", "CaseDetails", new { CaseID = Model.CaseID });

                      tabCaseDetails.Add().Text("Descriptions")
                        .LoadContentFrom("CaseDescriptions", "CaseDetails", new { CaseID = Model.CaseID });

                      tabCaseDetails.Add().Text("Relations")
                        .LoadContentFrom("CaseRelations", "CaseDetails", new { CaseID = Model.CaseID });


                  })


<script type="text/javascript">
function onDetailsListChanged() {
      
        var val1 = "cmbDetails_" + "@Model.CaseID";
        var value = $("#" + val1).val();
        var id = "tabDetails_" + "@Model.CaseID";
        $("#" + id).kendoTabStrip().data("kendoTabStrip").select(value);  //set the selected tab page
     $("#" + id).kendoTabStrip().reload(value); // try to reload the data  not work

    }
</script>

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Oct 2013, 01:51 PM
Hello,

The reload method does not accepts an index but a tab element or a selector so you should find the tab element that you wish to reload or provide a valid selector. You should also get the existing tab instance instead of initializing each time:

var tabstrip = $("#" + id).data("kendoTabStrip");
tabstrip.select(value);
tabstrip.reload(tabstrip.items()[value]);
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kevin
Top achievements
Rank 1
answered on 10 Jul 2019, 05:45 PM

Can you show how to get the existing tab instance?

@(Html.Kendo().TabStrip()
                .Name("display-tabstrip")
                .Animation(animation =>
                    animation.Open(effect =>
                        effect.Fade(FadeDirection.In)))
        .Items(tabstrip =>
        {
            tabstrip.Add().Text("Safety")
               .Selected(true)
               .LoadContentFrom("MonthlySafetyChart", "Display");
            tabstrip.Add().Text("PSA")
               .LoadContentFrom("MonthlyPSAGauge", "Display", new { dvm = Model});
        })
)

 

This is my tabstrip code but the dvm in the MonthlyPSAGauge keeps returning as null.

 

0
Ianko
Telerik team
answered on 12 Jul 2019, 08:37 AM
Hi Kevin,

As the forum thread here is very old I suggest you to create a new thread or open a support case and provide more details on the case you have difficulties with. For example, is the TabStrip in a partial view? Is the Model assigned to the view? Also, if possible, provide a simple, locally runnable project that demonstrates the issue you have. 

Regards,
Ianko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
InQuera LTD
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Kevin
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or