zuriosam
zuriosam

Reputation: 115

How to format a label in ExtJS to look like a link

How can a label be formatted to have look of a link in extjs? I don't want to have link functionality (to go to specific href). I would like just to have classical button which looks like a link and have click listeners.

I've tried with the following code:

{
  xtype: 'box',
  autoEl: {tag: 'a', href: 'http://www.google.com', html: 'Google'}
}

but, this is classical link.

I also tried

{
xtype: 'box',
html: '<a href="" class="link-forgot-password"> Forgot Password ?/a>'
}

That looks fine, but what is missing is listener.

Upvotes: 0

Views: 152

Answers (1)

Arthur Rubens
Arthur Rubens

Reputation: 4706

Something like this:

{
    xtype: 'box',
    html: '<a href="#" class="link-forgot-password"> Forgot Password ?/a>',
    listeners: {
        el: {
            click: function () {
                console.log('click');
            },
            scope: this
        }
    }
}

Upvotes: 3

Related Questions