[CLOSED] Hyperlink Client API?

  1. #1

    [CLOSED] Hyperlink Client API?

    Hi,

    Where is the client-side API for the ext.net Hyperlink class? Through searching I was able to find another forum post detailing the client method setUrl, but I could not find a list of members/methods/events in the sencha api. Is this available anywhere?
    Last edited by Daniil; Aug 23, 2012 at 4:13 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Unfortunately, we have no docs for HyperLink.

    Here is the full sources. The valueElement function is private and should not be used by a developer.

    The destination of the rest methods and its arguments should be understandable. Please ask if you have any questions.

    HyperLink
    Ext.net.HyperLink = Ext.extend(Ext.form.Label, {
        cls : "",
        url : "#",
    
        valueElement : function () {
            var textEl = document.createElement("a");
            
            textEl.style.verticalAlign = "middle";
            
            if (!Ext.isEmpty(this.cls, false)) {
                textEl.className = this.cls;
            }
    
            textEl.setAttribute("href", this.url);
            
            this.textEl = Ext.get(textEl);
            this.textEl.setOverflow = Ext.emptyFn;
    
            if (this.disabled) {
                textEl.setAttribute("disabled", "1");
                textEl.removeAttribute("href");
            }
    
            if (!Ext.isEmpty(this.target, false)) {
                textEl.setAttribute("target", this.target);
            }
    
            if (this.imageUrl) {
                textEl.innerHTML = '<img src="' + this.imageUrl + '" />';
            } else {
                textEl.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || "");
            }
            
            return textEl;
        },
    
        setDisabled : function (disabled) {
            Ext.net.HyperLink.superclass.setDisabled.apply(this, arguments);
            
            if (disabled) {
                this.textEl.dom.setAttribute("disabled", "1");
                this.textEl.dom.removeAttribute("href");
            } else {
                this.textEl.dom.removeAttribute("disabled");
                this.textEl.dom.setAttribute("href", this.url);
            }
        },
    
        setImageUrl : function (imageUrl) {
            this.imageUrl = imageUrl;
            this.textEl.dom.innerHTML = '<img style="border:0px;" src="' + this.imageUrl + '" />';
        },
    
        setUrl : function (url) {
            this.url = url;
            this.textEl.dom.setAttribute("href", this.url);
        },
    
        setTarget : function (target) {
            this.target = target;
            this.textEl.dom.setAttribute("target", this.target);
        }
    });
    
    Ext.reg("nethyperlink", Ext.net.HyperLink);
  3. #3
    Thank you Daniil, I'll try to remember to check the source for this kind of thing.

Similar Threads

  1. [CLOSED] Hyperlink Example
    By trezv in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 20, 2012, 2:41 PM
  2. HyperLink in HtmlEditor is not working
    By reezvi in forum 1.x Help
    Replies: 6
    Last Post: May 17, 2012, 5:40 PM
  3. Replies: 6
    Last Post: Feb 22, 2012, 5:43 PM
  4. [CLOSED] Hyperlink Bug
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Feb 23, 2011, 8:28 AM
  5. Replies: 0
    Last Post: Sep 17, 2009, 8:04 AM

Posting Permissions