Reputation: 2842
How can I do a tab strip in kendo ui with render partial...
This is what I have been trying
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Items(tabstrip =>
{
tabstrip.Add().Text("COES Details")
.Selected(true)
.Content(@<text>
@{Html.RenderPartial("ViewCOESDetails", @Model.COESDetails);}
</text>);
tabstrip.Add().Text("New York")
.Content(@<text>
<div class="weather">
<h2>29<span>ºC</span></h2>
<p>Sunny weather in New York.</p>
</div>
<span class="sunny"> </span>
</text>);
tabstrip.Add().Text("Moscow")
.Content(@<text>
<div class="weather">
<h2>16<span>ºC</span></h2>
<p>Cloudy weather in Moscow.</p>
</div>
<span class="cloudy"> </span>
</text>);
tabstrip.Add().Text("Sydney")
.Content(@<text>
<div class="weather">
<h2>17<span>ºC</span></h2>
<p>Rainy weather in Sidney.</p>
</div>
<span class="rainy"> </span>
</text>);
})
)
It just shows the page on the outside of the tab... what is the correct syntax...
any ideas?
Thanks
Upvotes: 6
Views: 12848
Reputation: 4125
I add multiple partial views to a tab strip. in this case, one partial view per tab:
@(Html.Kendo().TabStrip()
.Name("Information")
.Items(tabstrip =>
{
tabstrip.Add().Text("Tab 1")
.Selected(true)
.Content(Html.Partial("~/Areas/People/Views/Contact/_AustraliaPartial.cshtml", Model.Australia).ToHtmlString());
tabstrip.Add().Text("Tab 2 ")
.Content(Html.Partial("~/Areas/People/Views/Contact/_NewZealandPartial.cshtml", Model.NewZealand).ToHtmlString());
tabstrip.Add().Text("Tab 3")
.Content(Html.Partial("~/Areas/People/Views/Contact/_SamoaPartial.cshtml", Model.Tonga).ToHtmlString());
}))
Upvotes: 6
Reputation: 2035
It now supports controller/actions
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Items(tabstrip =>
{
tabstrip.Add().Text("File").LoadContentFrom("FileTab","Home");
})
)
and in the Home Controller:
public ActionResult FileTab()
{
return PartialView("_FileTabPartial");
}
Hope this helps
Upvotes: 8
Reputation: 81
tabstrip.Add().Text("COES Details").Enabled(true) .Content(@Html.Partial("path of the Partialview", Model).ToHtmlString());
Upvotes: 8