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

[Solved] Disabling the tabstrip on pageLoad

0 Answers 94 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anil
Top achievements
Rank 1
Anil asked on 23 Jun 2010, 01:55 PM
I have a tabstrip on a page,
<% Html.Telerik().TabStrip()
       
.Name("TabStrip")
       
.Items(tabstrip =>
       
{
            tabstrip
.Add()
                   
.Text("Based on jQuery")
                   
.Content(() =>
                   
{%>
                       
<p>
                            The client-side code of the Telerik Extensions for ASP.NET MVC is based on
                         
</p>
                   
<%});

            tabstrip
.Add()
                   
.Text("Cross-browser Support")
                   
.Content(() =>
                   
{%>
                       
<p>
                            Telerik is renowned for making its product consistent across all major browsers:
                          
</p>
                   
<%});
            
           
        })
       
.Render(); %>


and a button that onclicking disables the second tab(index -> 1) on the tabstrip,
<button class="t-button t-state-default" onclick="Disable()">Disable</button>

It calls the javascript function as follows,
 <script type="text/javascript">
       
function Disable() {
           
var tabstrip = $("#TabStrip").data("tTabStrip");
           
var item = $("li", tabstrip.element)["1"];

            tabstrip
.disable(item);
       
}
   
</script>
 This works fine. But what I need is that I should be able to disable the tabs on the tabstrip on pageload i.e. onLoad event.
I tried calling the function on

$(document).ready(function() {

 Disable() ;
});

But it does not work.Please let me know if we can disable a tab on tabstrip on OnLoad event.
Thanks
Anil
Tags
TabStrip
Asked by
Anil
Top achievements
Rank 1
Share this question
or