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

Disabling a not selected tab

5 Answers 1043 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Paramhans
Top achievements
Rank 1
Paramhans asked on 13 Sep 2012, 11:01 AM
I binding datasource to generate the tabs dynamically in tabStrip control. For each tab in tabstrip i have a check box on the form. My Requirement is: 
initially all the tabs will be disabled and on check change event of checkboxes i need to enable or disable the respective tabs based on check state of the currently changing checkbox.

I have already tried below code: 

var cb_click = function (e) {
            var $this = $(this);     // $this will contain a reference to the checkbox  
            var tabstrip = $("#myTabStrip").data("kendoTabStrip");
            var selTab = tabstrip.select(tabstrip.tabGroup.children("li[innerText='" + $this.val() + "']"));
            if ($this.is(':checked')) {
                tabstrip.enable(selTab, true);
            }
            else {
                tabstrip.enable(selTab, false);


                //selTab.css('class', 'k-state-disabled');
            }
        };

Please help me find a solution for this issue.

5 Answers, 1 is accepted

Sort by
0
Majid
Top achievements
Rank 1
answered on 26 Sep 2012, 09:31 PM
This is how I do it:

var ts = $("#tabstrip").data("kendoTabStrip");
var tabIndex = 1;
ts.enable(ts.tabGroup.children("li:eq(tabIndex)"), true); // enable tab 1

ts.enable(ts.tabGroup.children("li:eq(tabIndex)"), false); // disable tab 1


0
David
Top achievements
Rank 2
answered on 03 Oct 2014, 05:02 PM
This deserves to be in the documentation. 
0
Petyo
Telerik team
answered on 08 Oct 2014, 09:01 AM
Hi David,

The feature in question is documented.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
David
Top achievements
Rank 2
answered on 08 Oct 2014, 01:21 PM
That is not the same thing. I tried what was in the documentation without any luck. 
0
Petyo
Telerik team
answered on 13 Oct 2014, 07:51 AM
Hi David,

perhaps I am missing something in this case - this is the code snippet in the documentation, and it seems to demonstrate the feature accurately.


Regards,
Petyo
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
Paramhans
Top achievements
Rank 1
Answers by
Majid
Top achievements
Rank 1
David
Top achievements
Rank 2
Petyo
Telerik team
Share this question
or