Removing all tabs (clear)

6 posts, 0 answers
  1. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 17 Mar 2012 Link to this post

    Is there a way to clear all the tabs?
    Thanks in advance.
  2. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 19 Mar 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Denis Vuyka
    Denis Vuyka avatar
    39 posts
    Member since:
    Oct 2009

    Posted 19 Mar 2012 Link to this post

    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
  5. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 22 Mar 2012 Link to this post

    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!
  6. Doug
    Doug avatar
    1 posts
    Member since:
    Jan 2012

    Posted 10 Feb 2014 in reply to Kamen Bundev Link to this post

    Kamen,

    Kendo Mobile lacks a tabGroup element. Using the latest release how would you remove a tabstrip?
  7. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 11 Feb 2014 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready