Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
89
rated 0 times [  90] [ 1]  / answers: 1 / hits: 23194  / 12 Years ago, wed, february 20, 2013, 12:00:00

I'm creating a method to delete a Kendo UI TabStrip Tab based on an 'x' image. I want it to work in the same way as other tab controls (such as Chrome/IE):




  • If the active tab is closed then select the next tab (or if it's the last tab then select previous tab).

  • If it's not an active tab then ensure the active tab remains open.



I believe I need to get a reference to the current tab, then check if the tab being deleted is the active tab.



My code at the moment simply closes the tab in relation to the clicked image:



function DeleteTab(imgObj) {

var tabStrip = $(#tabstrip).data(kendoTabStrip);

var deleteIndex = $(imgObj).closest(li).index();
tabStrip.remove(deleteIndex);
}


How do I get a reference to the currently selected tab? Can I do this by searching for k-state-active?


More From » jquery

 Answers
530

tabstrip.select() will return the currently selected tab.


[#80108] Tuesday, February 19, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bryantc

Total Points: 455
Total Questions: 96
Total Answers: 110

Location: San Marino
Member since Thu, Jun 30, 2022
2 Years ago
bryantc questions
Fri, Aug 13, 21, 00:00, 3 Years ago
Tue, Mar 30, 21, 00:00, 3 Years ago
Fri, Jun 5, 20, 00:00, 4 Years ago
Wed, May 27, 20, 00:00, 4 Years ago
;