This is a migrated thread and some comments may be shown as answers.

Removing all tabs (clear)

5 Answers 957 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Denis Vuyka
Top achievements
Rank 1
Denis Vuyka asked on 17 Mar 2012, 08:32 AM
Is there a way to clear all the tabs?
Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 19 Mar 2012, 10:38 AM
Hi Denis,

You can pass a jQuery object or just a selector to the TabStrip's remove() method and it will remove all matching tabs.

Greetings,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Denis Vuyka
Top achievements
Rank 1
answered on 19 Mar 2012, 03:45 PM
Hello Kamen,

Maybe I'm doing something wrong, but I cannot clear the tabs and yet have TabStrip functioning properly after that. I've tried the following approaches:

1. Clears, but has problems appending new items after that:
var tabStrip = $("#tabstrip");
tabStrip.empty();
2. Clears but leaves the content of the selected tab visible, has problems appending new items after that:
var tabStrip = $("#tabstrip").data("kendoTabStrip");
tabStrip.remove(tabStrip.tabGroup);
3.Clears, but crashes next time an item is appended:
var tabStrip = $("#tabstrip").data("kendoTabStrip");
tabStrip.remove($('#tabstrip'));
Do you have any working samples for clearing TabStrip and still having it functioning properly? Or should I use "remove" method differently? Thanks, Denis
0
Kamen Bundev
Telerik team
answered on 22 Mar 2012, 01:58 PM
Hello Denis,

You need to pass the items (LI elements), that represent every tab in the TabStrip. Something like this:
tabStrip.remove(tabStrip.tabGroup.children());

All the best,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Doug
Top achievements
Rank 1
answered on 10 Feb 2014, 10:22 PM
Kamen,

Kendo Mobile lacks a tabGroup element. Using the latest release how would you remove a tabstrip?
0
Kamen Bundev
Telerik team
answered on 11 Feb 2014, 08:38 AM
Hello Doug,

This thread (and forum) are targeting TabStrip for Kendo UI Web, please post your questions in the relevant forums.

As for the TabStrip - removing one is not officially supported, but generally every Kendo Widget has a destroy method, which will remove the Widget's Kendo object and leave only the DOM structure - you will need to remove that yourself. Please note that, if the TabStrip is part of a layout, this will not work.

Regards,
Kamen Bundev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TabStrip
Asked by
Denis Vuyka
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Denis Vuyka
Top achievements
Rank 1
Doug
Top achievements
Rank 1
Share this question
or