Change Tab / PageView on client-side

3 posts, 0 answers
  1. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 26 Mar 2014 Link to this post

    I would like to have an event fired from a image map hotspot on a multi-page layout with associated tab strip.

    Currently I have this working where I open a LightBox control via a script I picked up from that forum.

    For one of the hot-spots I would rather have it change tabs, i.e. just as if the user clicked on another tab.

    I've tried the following, but 99% of what I know is server-side, so assume I know NOTHING about how this works on the client.
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
     
    <script type="text/javascript">
        function OpenAboutLightBox(index)
        {
            var lightBox = $find('<%= AboutLightBox.ClientID %>');
            lightBox.set_currentItemIndex(index);
            lightBox.show();
        }
        function switch_tab(index)
        {
            var tabstrip = $find('<%= RadTabStrip1.ClientID%>');
            tabstrip.index = index;
     
            var multipage = $find('<%= RadMultiPage1.ClientID%>');
            multipage.index = index
        }
    </script>
     
    </telerik:RadCodeBlock>

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Mar 2014 in reply to Tomica Link to this post

    Hi Tomica,

    Please try the following JavaScript code snippet to change RadTab from client side.

    JavaScript:
    <script type="text/javascript">
        function switch_tab(index) {
            var radtabstrip = $find("<%=RadTabStrip1.ClientID %>");
            radtabstrip.set_selectedIndex(index);
        }
    </script>

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 27 Mar 2014 in reply to Shinu Link to this post

    Yes, this works fine.
Back to Top