Skip to content

Ho to show URL in text field

Kyryl Krylov, CPA edited this page Apr 8, 2020 · 1 revision
  1. Add the following properties to already defined Text filed
"showValueAsLink": true,
"href": {
    "bindTo": "UsrFieldName",
    "bindConfig": {"converter": "getUsrFieldNameLink"}
},
"controlConfig": {
    "className": "Terrasoft.TextEdit",
    "linkclick": { bindTo: "onUsrFieldNameLinkClick"}
}
  1. Add 2 methods
getUsrFieldNameLink: function(value) {
    return {
        "url": value,
        "caption": value
    };
},
onUsrFieldNameLinkClick: function(url) {
    if (url != null) {
        window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth"));
        return false;
    }
}