RowGroup of column using custom rendering (AJAX)
RowGroup of column using custom rendering (AJAX)
Hi. I have a table populated with AJAX data that has a date column. I'd like to group the data in the table by month name, so I created a column that I setup as follows:
{
data: "startDate",
visible: false,
render: function (data) {
return moment(data).format("MMMM");
}
}
My problem is that I can't see to figure out how to get rowGroup
to group by the month name. When I try setting rowGroup
to true
(with the above column as my first column) or set it to the specific column number, nothing happens. I assume this is because I am using AJAX data. Is there a way to get this to work other than adding "month" to the database?
This question has an accepted answers - jump to answer
Answers
I did eventually solve this myself. Rather than creating a column, I put the data to group by function as part of "rowGroup", for example:
@matthew_b Great ! It works fine. Now, need to combine with other rendering options to customize the row
Very helpful! Thank you.