diff --git a/Mvc.JQuery.Datatables.Example/Views/Home/Index.cshtml b/Mvc.JQuery.Datatables.Example/Views/Home/Index.cshtml
index 3a2b628..77553b2 100644
--- a/Mvc.JQuery.Datatables.Example/Views/Home/Index.cshtml
+++ b/Mvc.JQuery.Datatables.Example/Views/Home/Index.cshtml
@@ -60,7 +60,7 @@ public class SomeController : Controller
.FilterOn("Id").NumberRange();
//.FilterOn("Number").CheckBoxes(Enum.GetNames(typeof(Numbers)));
vm.StateSave = true;
-
+ //vm.DrawCallback = "drawCallback";
if (Request.QueryString["lang"] == "de")
{
@@ -91,6 +91,11 @@ public class SomeController : Controller
function test(data, type, full) {
return '' + data + '';
}
+
+ function drawCallback(oSettings) {
+ console.log('fnDrawCallback fired');
+ console.log(oSettings);
+ }
@Html.Partial("DataTable", vm)
diff --git a/Mvc.JQuery.Datatables.Templates/Views/Shared/DataTable.cshtml b/Mvc.JQuery.Datatables.Templates/Views/Shared/DataTable.cshtml
index 3f7ae90..56e7910 100644
--- a/Mvc.JQuery.Datatables.Templates/Views/Shared/DataTable.cshtml
+++ b/Mvc.JQuery.Datatables.Templates/Views/Shared/DataTable.cshtml
@@ -59,18 +59,23 @@
{
,"oLanguage": @Html.Raw(@Model.Language)
-
+
+ }
+ @if (!string.IsNullOrEmpty(Model.DrawCallback))
+ {
+
+ ,"fnDrawCallback": @Html.Raw(Model.DrawCallback)
}
});
@if (Model.ColumnFilter)
{
-
- dt.columnFilter({
- sPlaceHolder: "head:before",
- aoColumns: [@Html.Raw(Model.ColumnFiltersString)]
- });
-
+
+ dt.columnFilter({
+ sPlaceHolder: "head:before",
+ aoColumns: [@Html.Raw(Model.ColumnFiltersString)]
+ });
+
}
})();
diff --git a/Mvc.JQuery.Datatables/DataTableConfigVm.cs b/Mvc.JQuery.Datatables/DataTableConfigVm.cs
index 19222bb..14f4cc6 100644
--- a/Mvc.JQuery.Datatables/DataTableConfigVm.cs
+++ b/Mvc.JQuery.Datatables/DataTableConfigVm.cs
@@ -123,6 +123,8 @@ public string ColumnSortingString
public string Language { get; set; }
+ public string DrawCallback { get; set; }
+
public string GetFilterType(string columnName, Type type)
{
foreach (Func filterTypeRule in FilterTypeRules)