|
@(Html.EJ().Tab("Musica")
.HeightAdjustMode(HeightAdjustMode.Content)
.ClientSideEvents(e => e.BeforeActive("before"))
.Items(data =>
{
data.Add().ID("Albums").Text("Albums").ContentTemplate(@<div id="Album"></div>); // Render the tab with div element
data.Add().ID("Artistas").Text("Artistas").ContentTemplate(@<div id="Artsista"></div>);
data.Add().ID("Generos").Text("Generos").ContentTemplate(@<div id="Genero"></div>);
}))
<script type="text/javascript">
var genData, ArtData,URL;
$("#Musica").ejTab({
create: function () { // bind intial Grid (tab1) using create for first time alone
$.ajax({
url: "/Home/GetAlbum",
success: function (doc) {
$("#Album").html(doc);
}
});
},
itemActive: function (args) {
if (args.activeIndex == 0) { // based on activeIndex set the url and ID
URL = "/Home/GetAlbum";
ID = "Album";
}
if (args.activeIndex == 1) {
URL = "/Home/GetArts";
ID = "Artsista";
}
if (args.activeIndex == 2) {
URL = "/Home/GetGenes";
ID = "Genero";
}
$.ajax({
url: URL,
success: function (doc) {
$("#" + ID).html(doc); // render Grid using partial view method
}
});
}
});
</script> |