{ data: 'message', render: function (data, type, row, meta) { //console.log(row); let prevRowData= []; if (meta.row > 0) { // Ensure there's a previous row prevRowData = table.row(meta.row - 1).data(); }else{ prevRowData['is_reply'] = 'f' prevRowData['is_admin_comment'] = '0' } html= '
'; if (row['parent_row'] == 'show_replies') { // html += '' } let replyLevel = Math.min(parseInt(row['is_reply'] ?? 0), 5); // clamp between 0–5 html += '
'; if (row['is_reply'] > 0) { let righticon = (replyLevel >= 2 && replyLevel <= 5) ? 'fa-angles-right' : 'fa-angle-right'; html += '' } else if (row['reaction'] != ''){ html += '' } html += '
' //first column html += '
' //second column html+= '
'+ row['name']+': '+ data +'
'; if ((row['authorClient'] !== null) && replyLevel == 0) { html += ((row['authorClient'].id !== null) ? '
' : ''); html += ((row['authorClient'].mentionColor !== null) ? '
' : ''); html += ((row['authorClient'].id !== null) ? '
'+ ' {{ __("applabels.Customer")}}: ' + row['authorClient'].name +'
': '') ; html += ((row['authorClient'].id !== null) ? '
' : ''); } html += '
'//second column html += '
'//main row return html; } }, { data: 'custom_reply', render: function (data, type, row, meta) { console.log(row) if ((row['is_admin_reply'] == 'y') || (row['is_admin_comment']) ){ html = '' ; } else { console.log('ELSE') html = '' ; } else { html += ' ' ; } } if (row['auto_admin_reply'] && row['is_reply']) { html= '' }; return html; } }, { data: 'replied', render: function (data, type, row, meta) { if ( (row['is_admin_reply'] == 'y') || (row['is_admin_comment']) || ((row['social'].toLowerCase() == 'instagram') && (row['status'] == 'BROADCAST') ) || row['prvt_msg'] ){ html = '' } else { html = '' ; } if (row['auto_admin_reply'] && row['is_reply']) { html= '';}; // '' return html; } },