Created
November 1, 2016 11:46
-
-
Save savelee/6d65fb7b2c22dbd46de38f812750c024 to your computer and use it in GitHub Desktop.
Custom component (part 3)
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: "", | |
enableExternalUrlIcon: true, | |
preventDefault: false, | |
renderTpl: [ | |
'<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>' | |
], | |
beforeRender: function () { | |
var me = this; | |
me.callParent(); | |
Ext.applyIf(me.renderData, { | |
anchorName: me.anchorName, | |
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