Problem with render
Problem with render
jmaurin
Posts: 3Questions: 0Answers: 0
Hi.
I'm trying to use render to display an Image, but it's not working.
My ideia is:
In the field 4, if the field 8 isn't empty, show field 4 + image from field 8.
This is my code:
$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"ajax": {
"url": "proc_flights.php",
"type": "POST"
},
"columnDefs": [ {
"targets": 4,
"render": function ( data, type, full, meta ) {
if (full[8]!='') {
return '<img src="'+full[8]+'" />';
} else {
return data;
}
}
} ]
} );
} );
Field 8 are returning 'TAM.png', but my brownser tries to get this URL:
http://radar.jonis.com.br/%27+full%5B8%5D+%27
If I just 'return full[8]', I got 'TAM.png' on my tables (this is correct), so the data is correct.
What I'm doing wrong?
I'm using XHTML.
Tks
This discussion has been closed.
Replies
Also, even using mRender and fixed image (just to text), no image is displayed.
Here is my table:
http://radar.jonis.com.br/
Solved....just don't use XHTML!
How odd - the code you have above should work nicely with XHTML.
But good to hear you have it working now!
Allan