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

Custom Sort for DataTable Column Based on Another Property

$
0
0

In my DataTable, one column has custom render logic, but its Sort has to happen directly based on the "reminderInfo" row property. This is not working.

"columns" : [        {
                "data" : "reminderInfo" /* also tried "sort" : "reminderInfo" */
                "render": function (data, type, row) {
                    if(row.reminderCount != null) {
                        return '<div class="reminder"><span class="fa-layers fa-fw fa-lg reminder-counter"><i class="fas fa-bell"></i><span class="fa-layers-counter">' + row.reminderCount + '</span></span>'
                                +'<div class="reminder-date">' + row.formattedLastReminderDate + '</div></div>';
                    } else {
                        return '';
                    }                      
                }
            }
        ],

The sorting does not follow the row's straight reminderInfo property.


Viewing all articles
Browse latest Browse all 82217

Trending Articles



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