DT 10 - Column rendering

DT 10 - Column rendering

deliatordeliator Posts: 95Questions: 1Answers: 0
edited February 2017 in Free community support

Hello,

In this case i need to display the content of column #5 if the value of column #2 start with "F" ...
How can i do this ?

{ render: function (data, type, row) {
     if ( data.length === 0)
          {return '<span class="text-danger">some text</span>';}   
     else if ( data.slice(0,1) == 'F' )
          {return '<span class="text-danger">content of column #5</span>';}   
     else 
          {return '<span>' + data + '</span>';}                                 
     },
     targets: [2]
}, 

Thanks a lot,

Marc

This discussion has been closed.