File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
Mvc.JQuery.Datatables.Example/Views/Home
Mvc.JQuery.Datatables.Templates/Views/Shared Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public class SomeController : Controller
6060 .FilterOn (" Id" ).NumberRange ();
6161 // .FilterOn("Number").CheckBoxes(Enum.GetNames(typeof(Numbers)));
6262 vm .StateSave = true ;
63-
63+ // vm.DrawCallback = "drawCallback";
6464
6565 if (Request .QueryString [" lang" ] == " de" )
6666 {
@@ -91,6 +91,11 @@ public class SomeController : Controller
9191 function test (data , type , full ) {
9292 return ' <i>' + data + ' </i>' ;
9393 }
94+
95+ function drawCallback (oSettings ) {
96+ console .log (' fnDrawCallback fired' );
97+ console .log (oSettings);
98+ }
9499 </script >
95100@Html.Partial( "DataTable", vm)
96101
Original file line number Diff line number Diff line change 5959 {
6060 < text>
6161 ," oLanguage" : @Html .Raw (@Model .Language )
62-
62+ < / text>
63+ }
64+ @if (! string .IsNullOrEmpty (Model .DrawCallback ))
65+ {
66+ < text>
67+ ," fnDrawCallback" : @Html .Raw (Model .DrawCallback )
6368 < / text>
6469 }
6570 });
6671 @if (Model .ColumnFilter )
6772 {
68- < text>
69- dt .columnFilter ({
70- sPlaceHolder: " head:before" ,
71- aoColumns: [@Html .Raw (Model .ColumnFiltersString )]
72- });
73- < / text>
73+ < text>
74+ dt .columnFilter ({
75+ sPlaceHolder: " head:before" ,
76+ aoColumns: [@Html .Raw (Model .ColumnFiltersString )]
77+ });
78+ < / text>
7479 }
7580 })();
7681 </script >
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ public string ColumnSortingString
123123
124124 public string Language { get ; set ; }
125125
126+ public string DrawCallback { get ; set ; }
127+
126128 public string GetFilterType ( string columnName , Type type )
127129 {
128130 foreach ( Func < string , Type , string > filterTypeRule in FilterTypeRules )
You can’t perform that action at this time.
0 commit comments