I would like to retain the selected tab when refreshing the page, or when navigating back from another page. I have some code to capture the currently selected tab:
function onSelect(e) { console.log(e.item.innerText) $.ajax({ type: "POST", url: "/Customers?handler=SelectTab&SelectedTab=" + e.item.innerText, beforeSend: function (xhr) { xhr.setRequestHeader("XSRF-TOKEN", $('input:hidden[name="__RequestVerificationToken"]').val()); } }); }
And I am using the following when the page loads, in order to set the selected tab on page load, but it doesn't show the tab properly (being called from $(document).ready):
function selectTab(tab) { var tabStrip = $("#customer-tabstrip").data("kendoTabStrip"); var t = $("li:contains('" + tab + "')"); tabStrip.select(t); tabStrip.activate(t); }