Reload Ajax content

3 posts, 1 answers
  1. William Dunn
    William Dunn avatar
    15 posts
    Member since:
    May 2010

    Posted 02 Jul 2013 Link to this post

    I have a panelbar in which the content is loaded via ajax.

    I would like to reload the content based on the change event in a dropdown list.  However, it doesn't appear that I can do this.

    I tried the reload() method on the panelbar object but it didn't do anything so I figured there was some caching involved.

    Can I trigger a reload to occur?

    Below is my client-side code and the panelbar.

    thanks
    var panelbar = $("#HomePanelBar").data("kendoPanelBar");
    panelbar.reload();
     
     @(Html.Kendo().PanelBar()
            .Name("HomePanelBar")
            .HtmlAttributes(new { style = "width:400px;" })
            .ExpandMode(PanelBarExpandMode.Single)
            .Items(panelBar =>
            {
                panelBar.Add()
                    .Text("Notification")
                    .HtmlAttributes(new { id = "item1" })
                    .Expanded(true)
                    .LoadContentFrom("_Announcement", "Help");
            })
        )
     


  2. Answer
    Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 04 Jul 2013 Link to this post

    Hello,

    The example in the documentation seems to be incorrect. The reload method accepts a selector for the items to be reloaded. In order to reload the panels you should use code similar to the one in the snippet:

    var panelbar = $("#HomePanelBar").data("kendoPanelBar");
    panelbar.reload("> .k-item");
    We will update the documentation as soon as possible.

    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
  4. William Dunn
    William Dunn avatar
    15 posts
    Member since:
    May 2010

    Posted 08 Jul 2013 Link to this post

    That did it.  Thank you very much!

Back to Top