Disabling a not selected tab

6 posts, 0 answers
  1. Paramhans
    Paramhans avatar
    1 posts
    Member since:
    Aug 2012

    Posted 13 Sep 2012 Link to this post

    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.
  2. Majid
    Majid avatar
    7 posts
    Member since:
    Sep 2012

    Posted 26 Sep 2012 Link to this post

    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


  3. Kendo UI is VS 2017 Ready
  4. David
    David avatar
    27 posts
    Member since:
    Jun 2014

    Posted 03 Oct 2014 Link to this post

    This deserves to be in the documentation. 
  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 08 Oct 2014 Link to this post

    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!
     
  6. David
    David avatar
    27 posts
    Member since:
    Jun 2014

    Posted 08 Oct 2014 in reply to Petyo Link to this post

    That is not the same thing. I tried what was in the documentation without any luck. 
  7. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 13 Oct 2014 Link to this post

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