FIX: Javascript error on mouse over a tab next to a separator (Q3 2009)

Thread is closed for posting
1 posts, 1 answers
  1. Answer
    Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 09 Nov 2009 Link to this post

    Problem
    When you hover a tab which is a sibling of a separator tab (IsSeparator=True) you get a javascript error:

    "className" is null or not an object


    Who is affected
    Everyone who uses Q3 2009 version (2009.3.1103) and have IsSeparator = True set for any of the tabs.


    Workaround
    Place the following javascript code right after the script manager's declaration:

    <script type="text/javascript"
    Telerik.Web.UI.RadTab.prototype._highlight = function () 
        if (this.get_hoveredCssClass()) 
            Sys.UI.DomElement.addCssClass(this.get_linkElement(), this.get_hoveredCssClass()); 
     
        var prev = this.get_previousTab(); 
        var next = this.get_nextTab(); 
        if (prev) { 
            var prevLink = prev.get_linkElement(); 
            if (prevLink) 
                Sys.UI.DomElement.addCssClass(prevLink, "rtsHoverBefore"); 
        } 
        if (next) { 
            var nextLink = next.get_linkElement(); 
            if (nextLink) 
                Sys.UI.DomElement.addCssClass(nextLink, "rtsHoverAfter"); 
        } 
         
        if (!this.get_enabled()) return
        if (!this.get_hoveredImageUrl()) return
        if (!this.get_imageElement()) return
         
        if (this.get_imageElement().src != this.get_hoveredImageUrl()) 
            this.get_imageElement().src = this.get_hoveredImageUrl(); 
    }; 
     
    Telerik.Web.UI.RadTab.prototype._unhighlight = function () 
        if (this.get_hoveredCssClass()) 
            Sys.UI.DomElement.removeCssClass(this.get_linkElement(), this.get_hoveredCssClass()); 
         
        var prev = this.get_previousTab(); 
        var next = this.get_nextTab(); 
        if (prev) { 
            var prevLink = prev.get_linkElement(); 
            if (prevLink) 
                Sys.UI.DomElement.removeCssClass(prevLink, "rtsHoverBefore"); 
        } 
        if (next) { 
            var nextLink = next.get_linkElement(); 
            if (nextLink) 
                Sys.UI.DomElement.removeCssClass(nextLink, "rtsHoverAfter"); 
        } 
             
        this._updateImage(); 
    }; 
    </script> 


    What is next
    The problem is already fixed and will be available in the next Latest Internal Build and the first service pack.



    We apologize for the caused inconvenience.


Back to Top