admin管理员组文章数量:1023764
I simply want to add a hyper link in my application. I tried the following code and the link is appearing in the page. But the on click event is not working. Can anyone please tell me what might be the reason?
xtype:'box',
isFormField: true,
id: "prospectStageLink",
style: "padding: 3px",
autoEl:{
//html: ' <a href>Link To Prospect</a>'
tag: 'a',
href: '#',
cn: 'Link To Prospect'
},
listeners: {
render: function(c){
c.on('click', function(e){
alert('clicked', 'hiii');
}, c, { stopEvent: true });
}
}
I simply want to add a hyper link in my application. I tried the following code and the link is appearing in the page. But the on click event is not working. Can anyone please tell me what might be the reason?
xtype:'box',
isFormField: true,
id: "prospectStageLink",
style: "padding: 3px",
autoEl:{
//html: ' <a href>Link To Prospect</a>'
tag: 'a',
href: '#',
cn: 'Link To Prospect'
},
listeners: {
render: function(c){
c.on('click', function(e){
alert('clicked', 'hiii');
}, c, { stopEvent: true });
}
}
Share
Improve this question
edited Nov 18, 2011 at 11:21
Chau
5,5709 gold badges67 silver badges99 bronze badges
asked Nov 18, 2011 at 9:36
spvspv
751 silver badge9 bronze badges
3 Answers
Reset to default 2try this :
listeners: {
render: function(ponent) {
ponent.getEl().on('click', function(e) {
alert('test');
});
}
}
I assume you are not running on ExtJS 4, because BoxComponent was removed from it.
Anyways, the simple explanation is probably that BoxComponent does not have a click
event. You might want to try using an Element instead, which does have support for the click
event.
xtype:'box',
isFormField: true,
id: "prospectStageLink",
style: "padding: 3px",
autoEl:{
//html: ' <a href>Link To Prospect</a>'
tag: 'a',
href: '',
onClick: 'nameYouFunction'
}
I simply want to add a hyper link in my application. I tried the following code and the link is appearing in the page. But the on click event is not working. Can anyone please tell me what might be the reason?
xtype:'box',
isFormField: true,
id: "prospectStageLink",
style: "padding: 3px",
autoEl:{
//html: ' <a href>Link To Prospect</a>'
tag: 'a',
href: '#',
cn: 'Link To Prospect'
},
listeners: {
render: function(c){
c.on('click', function(e){
alert('clicked', 'hiii');
}, c, { stopEvent: true });
}
}
I simply want to add a hyper link in my application. I tried the following code and the link is appearing in the page. But the on click event is not working. Can anyone please tell me what might be the reason?
xtype:'box',
isFormField: true,
id: "prospectStageLink",
style: "padding: 3px",
autoEl:{
//html: ' <a href>Link To Prospect</a>'
tag: 'a',
href: '#',
cn: 'Link To Prospect'
},
listeners: {
render: function(c){
c.on('click', function(e){
alert('clicked', 'hiii');
}, c, { stopEvent: true });
}
}
Share
Improve this question
edited Nov 18, 2011 at 11:21
Chau
5,5709 gold badges67 silver badges99 bronze badges
asked Nov 18, 2011 at 9:36
spvspv
751 silver badge9 bronze badges
3 Answers
Reset to default 2try this :
listeners: {
render: function(ponent) {
ponent.getEl().on('click', function(e) {
alert('test');
});
}
}
I assume you are not running on ExtJS 4, because BoxComponent was removed from it.
Anyways, the simple explanation is probably that BoxComponent does not have a click
event. You might want to try using an Element instead, which does have support for the click
event.
xtype:'box',
isFormField: true,
id: "prospectStageLink",
style: "padding: 3px",
autoEl:{
//html: ' <a href>Link To Prospect</a>'
tag: 'a',
href: '',
onClick: 'nameYouFunction'
}
本文标签: javascriptAdding a listener to hyperlink in ExtJSStack Overflow
版权声明:本文标题:javascript - Adding a listener to hyperlink in ExtJS - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745511091a2153829.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论