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

scrollIntoView throws javascript error

1 Answer 43 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Paresh Patel
Top achievements
Rank 1
Paresh Patel asked on 01 Dec 2009, 12:47 PM
Hi,
 I have 9 tabs in TabStrip. It is not possible to display all the tabs in a single line. so i used 'ScrollChildres=true'. but i am facing problem that when last two tabs are selected they are not visible in view. i found javascript code to scroll tabs from http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/set-scrollposition-to-active-tab-on-page-load.aspx .
Just to test, i cerated a javascript function and calling on a button. but on clicking on the button it throws javascript error:
Error: 'getTab(...)' is null or not an object.

The code is given below:
I am using version 2009.2.826.35.

by default SelectedIndex is set to 7.

 <telerik:RadTabStrip ID="rdTab" runat="server" SelectedIndex="7" Width="930" ScrollChildren="true" 
            ScrollButtonsPosition="Right" AutoPostBack="true"
            <Tabs> 
                <telerik:RadTab Text="aaaaaaaaa 1111111" runat="server" /> 
                <telerik:RadTab Text="bbbbgggg 22222" runat="server" /> 
                <telerik:RadTab Text="ccccccc 9999999" runat="server" /> 
                <telerik:RadTab Text="dddddhhhhh 5555555" runat="server" /> 
                <telerik:RadTab Text="eeeeeeeeeeeee 22222222" runat="server" /> 
                <telerik:RadTab Text="ffffff 8888888" runat="server" /> 
                <telerik:RadTab Text="gggggggg Test 2222" runat="server" /> 
                <telerik:RadTab Text="hhhhhhh 111111" runat="server" /> 
                <telerik:RadTab Text="iiiiiiiiii 0000" runat="server" /> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <input type="button" value="View" onclick="setSelectedTab()" /> 
 
        <script type="text/javascript"
            function setSelectedTab() 
            { 
                var obj = $find('<%= rdTab.ClientID %>'); 
                obj.get_selectedTab().scrollIntoView(); 
            }; 
        </script> 


Thanks,

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 04 Dec 2009, 08:38 AM
Hi Paresh Patel,

This is a known problem and we will fix it for the SP1 scheduled for the middle of the next week.

Stay tuned.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TabStrip
Asked by
Paresh Patel
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or