Last active
November 1, 2016 11:47
-
-
Save savelee/9c41aac37b34468f68a8bbd243807e44 to your computer and use it in GitHub Desktop.
Custom hyperlink component (part 2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('ExtAddonHref.component.Href', { | |
extend: 'Ext.Component', | |
xtype: 'extaddonhref', | |
target: "_blank", | |
url: "", | |
title: "", | |
anchorName: "", | |
preventDefault: false, | |
enableExternalUrlIcon: true, | |
tpl: [ | |
'<a class="hrefcomponent" href="{url}"', | |
'<tpl if="target"> target="{target}"</tpl>', | |
'<tpl if="enableExternalUrlIcon">rel="external"</tpl>', | |
'<tpl if="anchorName"> name="{anchorName}"</tpl>', | |
'>{title}</a>' | |
], | |
initComponent: function() { | |
var me = this; | |
me.callParent(); | |
me.data = { | |
anchorName: me.anchorName, | |
enableExternalUrlIcon: me.enableExternalUrlIcon, | |
url: me.url, | |
target: me.target, | |
title: me.title | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment