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

$.fn.dataTable.render.text combine with render: function(data, type, row)?

$
0
0

I have a requirement to safely output html and script, which I've learned I should use $.fn.dataTable.render.text() to achieve. Trouble is, I'm currently using render: function(data, type, row) and within that function I have some logic to decide what value to output. In most cases I'm simply rendering 'data' but in one case I'm rendering a different field in the row object.

How can I achieve safe rendering of html and script in this case? Here is my current function:

render: function(data, type, row){
    if(row.Type__c === 'Chat'){
        return row.Live_Chat_Transcript__r.Body;
    }else{
        return data;
    }
}

Viewing all articles
Browse latest Browse all 82238

Trending Articles



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