PDA

View Full Version : How to control hyperlink in MVC



atul.sachan@capgemini.com
8 Feb 2012, 9:46 PM
I am using MVC for our application and unable to control hyperlink functionality via controller.
could you please suggest any alternate for the same.
Thanks.

friend
9 Feb 2012, 4:44 AM
MVC event handling is only for ExtJS Components.

As an alternative, you can do this:

Simple/dumb anchor tag:


{
xtype: 'container',
html: '<a href="#">This is a link!</a>',
itemId: 'mailLink',
}


Ext Click event registration:



Ext.ComponentQuery.query('#mailLink')[0].el.on('click', function() {
Ext.Msg.alert('Click Event', 'You clicked the target link!');
});