TabStrip reload data

2 posts, 0 answers
  1. InQuera LTD
    InQuera LTD avatar
    1 posts
    Member since:
    Feb 2008

    Posted 14 Oct 2013 Link to this post

    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>

  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 16 Oct 2013 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top