how How to determine tabs exist TabStrip

3 posts, 0 answers
  1. Seaman
    Seaman avatar
    22 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2013 Link to this post

    hi all:
    i hava some question
    1.how How to determine tabs exist TabStrip,if  exist select it,else create a new tabs?
    2.as extjs,allow close a tabs show a 'x' close button?
    please help me ,thanks
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 27 Mar 2013 Link to this post

    Hi Seaman,


    If you would like to check if some specific tab exists, you could assign a unique id to the tabs and perform the check with jQuery.
    E.g.
    function removeOrAdd(){
       var tabstrip = $("#tabstrip").data("kendoTabStrip");
       if($("#item1").length){
           tabstrip.remove($("#item1"));
       } else {
           tabstrip.append(
           {
               text: "New Item",
               content: "content"
           });
       }
    }

    You could take a look at the following JS Bin example which demonstrates this.

    Regarding your second question if you are referring to removing the tab from the widget, you could use some custom button in the TabStrip markup, and call the remove method on click.

     

    Regards,
    Dimiter Madjarov
    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. Seaman
    Seaman avatar
    22 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2013 Link to this post

    hi Dimiter
      Thank you for your answer my question, I'll try that.
Back to Top