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

how How to determine tabs exist TabStrip

2 Answers 290 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Seaman
Top achievements
Rank 1
Seaman asked on 27 Mar 2013, 05:49 AM
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 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 27 Mar 2013, 04:11 PM
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!
0
Seaman
Top achievements
Rank 1
answered on 27 Mar 2013, 04:18 PM
hi Dimiter
  Thank you for your answer my question, I'll try that.
Tags
TabStrip
Asked by
Seaman
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Seaman
Top achievements
Rank 1
Share this question
or