IF inside createdRow not workinging
IF inside createdRow not workinging

Hello.
I have a createdRow that works perfectly without an if, but when informed the desired does not happen, could you help me?
Follow code
var table = $('#hidden-table-info').DataTable({bFilter: true,paging: true,destroy: true,data: result.d.data,language: {"emptyTable": "Nenhuma informação encontrada"
},columnDefs: [{ className: 'text-center', targets: [0, 1, 2, 3] },],columns: [{ "data": "Documento" },{ "data": "ChapaEmissor" },{ "data": "Status" },{ "data": "Minuta" }],createdRow: function (row, data, dataIndex) {if (data === "37654800"){$(row).addClass('important btn-btn danger');}}});
Thanks!
Replies
The
data
parameter increatedRow
will be an object containing the whole row. Not sure which column you are interested in but if its theStatus
column for example you would use something likeif (data.Status === "37654800")
. See thecreatedRow
docs for examples.Kevin