TabStrip reload data

4 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
    2230 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. Kevin
    Kevin avatar
    3 posts
    Member since:
    May 2019

    Posted 10 Jul in reply to Daniel Link to this post

    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.

     

  4. Ianko
    Admin
    Ianko avatar
    1896 posts

    Posted 12 Jul Link to this post

    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.
Back to Top