If you inspect the code generated in the web browser, you will notice for example, that the .ID("Info") is not for the <li> element but for the <div> with the content rendered for that tab.
@helper TabAppliedToCategories() {
}
@(Html.EJ().Tab("discount-edit")
.Items(data =>
{
data.Add()
.ID("AppliedToCategories")
.Text("Admin.Promotions.Discounts.AppliedToCategories")
.ContentTemplate(@<div>@TabAppliedToCategories()</div>);
}).ClientSideEvents(e=>e.Create("onCreate"))
)
<script>
function onCreate() {
var tabObj = $("#discount-edit").data("ejTab");
// To hide the specified tab item, please use the below code.
tabObj.hideItem(0);
}
</script>
|
// To show the specified tab item, please use the below code instead of above script code.
<script>
function onCreate() {
var tabObj = $("#discount-edit").data("ejTab");
tabObj.showItem(0);
}
</script>
|
var tabObj = $("#discount-edit").data("ejTab");
$(tabObj.items[tabObj.selectedItemIndex()]); |
$("a[rel='nofollow' href=#AppliedToCategories]").closest("li"); |