Refresh PanelBar with LoadContent

2 Answers 69 Views
PanelBar
Sean
Top achievements
Rank 1
Iron
Iron
Sean asked on 29 Mar 2023, 02:34 PM

I am  using the PanelBar with Items Binding. I am LoadingContent on the Expansion of a Panel.  I would like to "refresh" or re load the content after a panel has been expanded, collapsed and then re-expanded.  Currently, the panel does not re-load the content.

 

Is there a way to force the panel to be re-loaded?

2 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 1
Iron
Iron
answered on 16 Sep 2023, 09:55 PM
I see they don't attempt to answer any forum questions once your subscription expires.
0
Antonio
Top achievements
Rank 1
Iron
answered on 17 Nov 2023, 03:02 AM
Try this, Sean.
@(Html.Kendo().PanelBar()
        .Name("myPanelBar")
        .ExpandMode(PanelBarExpandMode.Multiple)
        .Items(panelbar =>
        {
            panelbar.Add().Text(@"Panel bar item 1")
                .HtmlAttributes(new { id = "panelBarItem1" })
                .LoadContentFrom("Index1", "MyController");

            panelbar.Add().Text(@"Panel bar item 2")
                .HtmlAttributes(new { id = "panelBarItem2" })
                .LoadContentFrom("Index2", "MyController");

        })
    )

<script>
// Reload first panel bar item. Call this from any event handler
var panelBar = $("#myPanelBar").data("kendoPanelBar");
panelBar.select("#panelBarItem1");
var selectPanelBarItem = panelBar.select();
panelBar.reload(selectPanelBarItem);
</script>

Tags
PanelBar
Asked by
Sean
Top achievements
Rank 1
Iron
Iron
Answers by
Sean
Top achievements
Rank 1
Iron
Iron
Antonio
Top achievements
Rank 1
Iron
Share this question
or