Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82464

Problem with render

$
0
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


Viewing all articles
Browse latest Browse all 82464

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>