You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a controller (see <astyle="color: dodgerblue;"href="https://github.com/mcintyre321/mvc.jquery.datatables/blob/master/Mvc.JQuery.DataTables.Example/Controllers/HomeController.cs">example</a>)
15
+
Create a controller (see <astyle="color: dodgerblue;"href="https://github.com/mcintyre321/mvc.jquery.datatables/tree/master/Mvc.JQuery.DataTables.Example/Controllers/HomeController.cs">example</a>)
IQueryable<User>users=... //take a queryable from your database...
25
-
varuserViews=users.Select(u=>newUserView(u)); //...transform it into a view object ...
24
+
varuserViews=users.Select(u=>newUserTableRowViewModel(u)); //...transform it into a view object ...
26
25
returnDataTablesResult.Create(userViews, dataTableParam) //...and return a DataTablesResult
27
26
}
27
+
28
+
28
29
}
29
30
</pre>
30
31
31
32
<p>
32
-
and render the partial (see <ahref="https://github.com/mcintyre321/mvc.jquery.datatables/blob/master/Mvc.JQuery.DataTables.Example/Views/Home/Index.cshtml">example</a>)
33
+
and render the partial (see <ahref="https://github.com/mcintyre321/mvc.jquery.datatables/tree/master/Mvc.JQuery.DataTables.Example/Views/Home/Index.cshtml">example</a>)
var dataTablesConfigVm = dataTablesConfigVmHtml.DataTableVm("table-id", (HomeController h) => h.GetUsers(null))
56
+
//set options on the config here, see <ahref="https://github.com/mcintyre321/mvc.jquery.datatables/tree/master/Mvc.JQuery.Datatables.Example/Views/Home/_ExampleTable.cshtml">example here</a>
/// <param name="q">A queryable for the data. The properties of this can be marked up with [DataTablesAttribute] to control sorting/searchability/visibility</param>
/// <param name="q">A queryable for the data. The properties of this can be marked up with [DataTablesAttribute] to control sorting/searchability/visibility</param>
31
18
/// <param name="dataTableParam"></param>
32
19
/// <param name="transform">//a transform for custom column rendering e.g. to do a custom date row => new { CreatedDate = row.CreatedDate.ToString("dd MM yy") } </param>
0 commit comments