UrlTextField.js (619B)
1 /** 2 * Simple text field with an URL button to easily visit the entered URL. 3 * 4 * The getUrl function may be overridden for custom functionality. 5 */ 6 Ext.define("PartKeepr.form.field.Text", { 7 extend: "Ext.form.field.Text", 8 9 alias: 'widget.urltextfield', 10 11 triggers: { 12 url: { 13 cls: 'x-form-trigger-link', 14 handler: function () { 15 if (this.getUrl() !== false) { 16 window.open(this.getUrl(), '_blank'); 17 } 18 }, 19 scope: 'this' 20 } 21 }, 22 getUrl: function () { 23 return this.getValue(); 24 } 25 });