Reputation: 9685
I'm trying to create a specialized class which should contain, among other things, a link and a image.
I have something like:
Ext.define('Macros.app.ribbonAction', {
extend: 'Ext.Component',
//extend: 'Ext.panel.Panel',
alias: 'widget.ribbonAction',
initComponent: function () {
Ext.apply(this, {
items:[
{}
]
}
);
this.callParent(arguments);
}
});
What's the best way to add a link (bound to a javascript function) to the items collection? The closest I can find is a button, but I'd really prefer a good old-fashioned link.
(I'm using ExtJs 4)
Upvotes: 1
Views: 2097
Reputation: 17860
How about standard box?
{
xtype: 'box',
id: 'myLinkId',
autoEl: '<a href="#">Link</a>'
}
And add this to the container.
The only problem is that you need to assign event handler for 'click' event and you can do this only after element has been rendered.
Upvotes: 4