I am using jEditable to edit a table inline, the third column of which contains email addresses. This column contains plaintext, but it is converted to mailto:
links using jQuery . Currently, when jEditable is activated, the user sees this: <a href="mailto:[email protected]">[email protected]</a>
How do I force jEditable to treat these <td>
s as plaintext, so that the user making the changes won't have to deal with HTML and will instead just see this: [email protected]
?
This is the jQuery concerned:
$(document).ready(function() {
var init;
$('table#data tbody td').editable( 'media/support/save.php', {
event: "dblclick",
submit: "OK",
cancel: "Cancel",
tooltip: "Double-click to edit...",
"callback": function(sValue,y) {
alert('The server has been updated.');
var aPos = init.fnGetPosition(this);
init.fnUpdate( sValue, aPos[0], aPos[1] );
}
});
var init = $("table#data").dataTable({
"sDom": 'lfr<"clear">tip<"clear">T',
"bStateSave": true,
"fnDrawCallback": function() {
$('table#data tbody tr').each(function() {
var email = $(this).find('td:last');
$(email).html('<a href="mailto:' + $(email).text() + '">' + $(email).text() + '</a>');
});
},
"aaSorting": [[ 0, "asc" ]]
});
});
I apologize for the big chunk of code, but most of it seemed important.