$("#btn").click(function () {
var tabObj = $("#defaultTab").data("ejTab");
for (var i = $("#defaultTab .e-item").length; i >= 0 ; i--) {
tabObj.removeItem(i);
}
tabObj.addItem("#new", "New Item", 3, "myClass", "newItem");
}); |
$(function () {
$("#defaultTab").ejTab({ cssClass: "custom"});
}); |
.custom.e-tab .e-header.e-addborderbottom .e-active {
border-top: 3px solid Red;
}
.custom.e-tab.e-js .e-header > .e-item:hover {
background-color: salmon;
} |
tabObj.addItem("#new", "New Item", 3, "myClass", "newItem");
$(".myClass").closest("li").css({"border-top": "2px solid red"}); |
<div id="tab">
<ul>
<li><a rel='nofollow' href="#Container">TreeGridContainer</a></li>
<li><a rel='nofollow' href="#Container2">TreeGridContainer2</a></li>
</ul>
<div id="Container">
<div id="TreeGridContainer" style="height:450px;"></div>
</div>
<div id="Container2">
<div id="TreeGridContainer2" style="height:450px;"></div>
</div>
</div>
<script type="text/javascript">
$(function () {
$("#tab").ejTab({ showCloseButton: true, cssClass: "custom", itemActive:"onClientActive" });
$("#TreeGridContainer").ejTreeGrid({
//
dataSource: dataManger1,
});
$("#TreeGridContainer2").ejTreeGrid({
dataSource: dataManger2,
//
})
});
function onClientActive(args) {
//To update the size of the hidden TreeGrid
if (args.activeIndex == 1) {
var treeObj = $("#TreeGridContainer2").data("ejTreeGrid"),
sizeSetting = { height: "450px", width: "100%" };
treeObj.setModel({ "sizeSettings": sizeSetting });
}
}
</script> |