Client-side Access to RadMultiPage

2 posts, 0 answers
  1. Doug
    Doug avatar
    73 posts
    Member since:
    Mar 2008

    Posted 14 Aug 2009 Link to this post

    Hello,

    I am in process of converting my client-side code from the RadControls Classic (ASP.NET Q3) to ASP.NET AJAX.  In my SharePoint page I have the following:

       <div onclick="PageViewClicked(tabStrip1,multiPage1)">
        <telerik:RadMultiPage runat="server"
         id="RadMultiPage1"
         CssClass="subTabs"
         SelectedIndex="-1">
        </telerik:RadMultiPage>
       </div>

       <script type="text/javascript">
        var tabTargetIndex;
        var multiPage1 = <%=RadMultiPage1.ClientID %>;
        var tabStrip1 = <%=RadTabStrip1.ClientID %>;
       </script>

    I have a JavaScript function that activates whenever the RadTabStrip is moused over:

     function OnClientMouseOverTabHandler(sender, eventArgs)
     {
    //  var pvIDArray = eventArgs.get_tab().get_pageViewID().split("_");
    //  var pvID = pvIDArray[3];
      var pvID = eventArgs.get_tab().get_index();

    alert(multiPage1.get_visible());  // THE CODE BREAKS HERE.  "multiPage1" reports as an object, but "get_visible()" breaks.

      multiPage1.set_selectedIndex(pvID);

      var pvIndex = multiPage1.get_selectedIndex();
    alert(pvIndex);  
      if(pvIndex != -1)
      {
       var pvClientID = multiPage1.PageViews[pvIndex].ClientID;  // THIS LINE UNFINISHED.
       var tabstripOffset = sender.get_tabs().getTab(0).get_element().offsetLeft;

       document.getElementById(pvClientID).className = "subTabs";
       document.getElementById(pvClientID).style.left = ((sender.get_tabs().getTab(eventArgs.get_selectedIndex()).get_element().offsetLeft)-tabstripOffset)+"px";

                if(!sender.get_tabs().getTab(eventArgs.get_selectedIndex()).get_enabled())
                {
                    document.getElementById(pvClientID).style.visibility = "hidden";
                }

       if(document.getElementById(pvClientID).offsetWidth < sender.get_tabs().getTab(eventArgs.get_selectedIndex()).get_element().offsetWidth)
       {
    //          document.getElementById(pvClientID).style.width = sender.get_tabs().getTab(eventArgs.get_selectedIndex()).get_element().offsetWidth + "px";
       }
      }
     }

     

    I cannot get the "multiPage1" object to respond to any of the client-side methods.  Does anyone have a clue?

    Many thanks,

    Doug

  2. Doug
    Doug avatar
    73 posts
    Member since:
    Mar 2008

    Posted 16 Aug 2009 Link to this post

    Please disregard.  I found the errors and corrected them per the documentation.  Thank you.
Back to Top