Skip to content

Instantly share code, notes, and snippets.

@savelee
Last active November 1, 2016 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save savelee/9c41aac37b34468f68a8bbd243807e44 to your computer and use it in GitHub Desktop.
Save savelee/9c41aac37b34468f68a8bbd243807e44 to your computer and use it in GitHub Desktop.
Custom hyperlink component (part 2)
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