Is it possible to add the createdRow event when initialize the Datatable. I am working on a plugin where I need to include this event to store manual updates to the datatable before saving the data to the database. My fix for now is to update the DataTablesModel Class and _Table.Definition.cshtml with the code snippets below. I would like the code change to be permanent in future releases if possible.
Add to DataTablesModel Class:
/// <summary>
/// Gets or sets custom created row function name(js)
/// See also https://datatables.net/reference/option/createdRow
/// </summary>
public string CreatedRowCallback { get; set; }
Add to _Table.Definition.cshtml:
@if (!string.IsNullOrEmpty(Model.CreatedRowCallback))
{
<text>
createdRow: function (row, data, dataIndex, cells) {
return @(Model.CreatedRowCallback)(row, data, dataIndex, cells);
},
</text>
}