PDA

View Full Version : Open links in the current tab instead of leaving the page.



akumar11
13 Feb 2012, 2:11 PM
I have a grid in a tab which has a column of hyper links. Clicking on a link should reload a new page within the same tab i.e. I would like to be able to open links in the current tab instead of leaving the page.

Can somebody give me some pointers as to how to go about this ?

Thanks!

mitchellsimoens
14 Feb 2012, 5:22 AM
You would need to use mon to listen for clicks on the <a> links and stop the event. Then you can do the logic to do what you want within your app...


grid.mon(grid.body, {
scope : grid,
delegate : 'a', // <-- maps to all <a> tags.
click : function(e, t) {
e.stopEvent();

//do you stuff here
}
});

Just typing off the top of my head but should work.