View Full Version : Mailto not working in Data View

2 Nov 2009, 5:46 AM
I use the following template in a DataView control. I have includes a "mailto" href. While the link is properly formed and displays correctly in the IE status bar on hover, clicking the link does not work.

Is there sonething I am missing?

'<tpl for=".">',
'<div class="search-item">',
'<table border="0" cellpadding="0" cellspacing="0" class="commentItem">',
'<td rowspan="2" valign="top" class="commentImage" align="center" nowrap>',
'<img border="0" src="{Image}" height="50"></td>',
'<td valign="top" class="commentTitle">{Topic}</td>',
'<td rowspan="2" valign="top" class="commentDate" nowrap>{Time:date("M j, Y g:i A")}<br><a href="mailto:{Email}?subject={Topic}">{Author}</a></td>',
'<td valign="top" class="commentText">{Comment}<br><br></td>',

2 Nov 2009, 6:03 AM
A DataView configured with singleSelect:true or multiSelect:true will select the row on click instead of allowing a link to be clicked.

Configure you DataView with singleSelect:false and multiSelect:false (which are the defaults, so you could also not specify them).

2 Nov 2009, 10:57 AM
Worked like a acharm. I just added the folowing code to the onclick event that does the record selection:

gridView.select(rowIndex, false, false );


2 Nov 2009, 1:48 PM
I had to add a little more to this so that I could do both fire the hyperlink and select the record with a behavior that makes more sense to the user. I set the initial Single Select property to false.

The onclick event now looks like this:

gridView.singleSelect = true;
gridView.singleSelect = false;

Thanks for the help...