PDA

View Full Version : Disable event of link



Mycoding
2 Dec 2010, 11:29 AM
Please give me advice.
How to disable event of link.
I mean disable following by address in href

danguba
2 Dec 2010, 12:27 PM
Why would U do that? If you need text to look like link but not to actually be a link just style it that way. But I wouldn't recommend it because that could confuse users

Mycoding
2 Dec 2010, 10:18 PM
I need like this example
http://dev.sencha.com/deploy/dev/examples/tasks/tasks.html

danguba
2 Dec 2010, 10:33 PM
Oh... well just do as they did... point your href to # and then get a listener on click event

eg:
link:

<a id="uniqueId" href="#">Simple Text</a>

listener:

Ext.fly('uniqueId').on('click', function(){alert('Huray')})

That should do the trick

Mycoding
2 Dec 2010, 11:06 PM
Thanks a lot.
I still dicide to use div instead of link.

Actually I have been trying to find really good dicision for that near 1 month.

I mean it would be perfect if link ivent don't add character '#' to url.

danguba
2 Dec 2010, 11:18 PM
But does it make any difference? Page won't get reloaded.