Closed sts-ryan-holton closed 2 years ago
What you describe sounds like what we call orthogonal data if I've understood correctly. Have a condition on the type
parameter to return different data for the different actions DataTables performs.
In future, could you post support requests in the DataTables forum, as the template issue text requests:
Please post support requests and questions in the DataTables forums at https://datatables.net/forums. Support requests posted here will be closed. The intention of this request is to allow all questions to be located in a single, searchable, location.
I'm using quite a few features of the newest DataTables version. I'm using the
render
function to return formatted data, and am using the thedata
key of each column to inject the column's data.The issue I'm facing, is that my
presentCellContents
function can return data including HTML and then my sorting (for example, highest to lowest) is then. lost as there's HTML in the cell.I thought DataTable's always used the
data
key in this context for sorting?I'd like to see a feature where I could add potentially.a
sort
orsortBy
key which would determine what to sort by regardless of the contents of the cell, for example, I have a "sessions" key which indicates how many times a user has landed on my web page, so I'd like to be able to sort on this regardless of any HTML returned in myrender
function.