Just typing off the top of my head:
Code:
Ext.define('Ux.LinkButton', {
extend : 'Ext.Component',
xtype : 'linkbutton',
text : null,
handler : Ext.emptyFn,
initComponent : function() {
var me = this;
me.html = '<a>' + me.text + '</a>';
me.callParent();
},
afterRender : function() {
var me = this;
me.callParent(arguments);
me.mon(me.el, {
scope : me,
delegate : 'a',
click : me.handleClick
});
},
handleClick : function(e) {
e.stopEvent();
this.handler.call(this, this);
},
setText : function(text) {
this.update('<a>' + text + '</a>');
}
});
new Ux.LinkButton({
renderTo : document.body,
text : 'Test',
handler : function(btn) {
console.log(btn);
}
});