如何将 ExtJS 中的标签格式化为 link
How to format a label in ExtJS to look like a link
如何将标签格式化为在 extjs 中具有 link 的外观?
我不想拥有 link 功能(转到特定的 href)。我只想拥有看起来像 link 的经典按钮并有点击监听器。
我试过以下代码:
{
xtype: 'box',
autoEl: {tag: 'a', href: 'http://www.google.com', html: 'Google'}
}
但是,这是经典link。
我也试过了
{
xtype: 'box',
html: '<a href="" class="link-forgot-password"> Forgot Password ?/a>'
}
看起来不错,但是缺少监听器。
像这样:
{
xtype: 'box',
html: '<a href="#" class="link-forgot-password"> Forgot Password ?/a>',
listeners: {
el: {
click: function () {
console.log('click');
},
scope: this
}
}
}
如何将标签格式化为在 extjs 中具有 link 的外观? 我不想拥有 link 功能(转到特定的 href)。我只想拥有看起来像 link 的经典按钮并有点击监听器。
我试过以下代码:
{
xtype: 'box',
autoEl: {tag: 'a', href: 'http://www.google.com', html: 'Google'}
}
但是,这是经典link。
我也试过了
{
xtype: 'box',
html: '<a href="" class="link-forgot-password"> Forgot Password ?/a>'
}
看起来不错,但是缺少监听器。
像这样:
{
xtype: 'box',
html: '<a href="#" class="link-forgot-password"> Forgot Password ?/a>',
listeners: {
el: {
click: function () {
console.log('click');
},
scope: this
}
}
}