kala-tamin using jquery datatable for server side processing with paging, filtering and search
صفحه اصلي

using jquery datatable for server side processing with paging, filtering and search



I need to use the jquery datatable server-side processing (http://datatables.net) for my asp.net mvc (C#) application.

My application has thousands of records to show in the table as list. I am using jquery datatable to enable paging, filtering and search.

Is there any good reference/articles for jquery datatable server-side processing to use with asp.net mvc (C#)?


MVC .NET 4.0 : Image Links

1:

Are there any action filters in your project you feel are a must-have?
https://github.com/johannes-brunner/DataTables-ASP.NET-MVC. New suggestions for error handling in ASP.NET MVC 2 This is an case project, you must download it and by debugging receive a feel for how DataTables works with .NET MVC. ASP.NET WebForms with MVC localization issueIt helped me receive find footing in the topic.. Is it possible to map complex types with SolrNet
Resolve Array with NinjectHow to use AJAX Post to invoke ASP.NET MVC Controller action and return new View?

2:

using different site.master files for themes
Hi this link may be helpful to you.... http://www.dotnetaweany .com/2015/11/jquery-datatable-server-side-pagination-sorting.html. Here the article around jQuery Datatable server side pagination and sorting in ASP.NET MVC , explained step by step in asp.net mvc (C#) as server dside I will refer this article [jQuery Datatable server side pagination and sorting in ASP.NET MVC. jQuery code for setup jQuery Datables.
<script>     $(document).ready(function () {         $("#myTable").DataTable({             "processing": true, // for show progress bar             "serverSide": true, // for process server side             "filter": false, // this is for disable filter (search box)             "orderMulti": false, // for disable multiple column at once             "ajax": {                 "url": "/home/LoadData",                 "type": "POST",                 "datatype": "json"             },             "columns": [                     { "data": "ContactName", "name": "ContactName", "autoWidth": true },                     { "data": "CompanyName", "name": "CompanyName", "autoWidth": true },                     { "data": "Phone", "name": "Phone", "autoWidth": true },                     { "data": "Country", "name": "Country", "autoWidth": true },                     { "data": "City", "name": "City", "autoWidth": true },                     { "data": "PostalCode", "name": "PostalCode", "autoWidth": true }             ]         });     }); </script> 
ASP.NET C# Code (MVC).
[HttpPost]     public ActionResult LoadData()     {          var draw = Request.Form.GetValues("draw").FirstOrDefault();         var start = Request.Form.GetValues("start").FirstOrDefault();         var length = Request.Form.GetValues("length").FirstOrDefault();         //Find Order Column         var sortColumn = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault();         var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();           int pageSize = length != null? Convert.ToInt32(length) : 0;         int skip = start != null ? Convert.ToInt32(start) : 0;         int recordsTotal = 0;         using (MyDatatableEntities dc = new MyDatatableEntities())         {              var v = (from a in dc.Customers select a);              //SORT             if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortColumnDir)))             {                 v = v.OrderBy(sortColumn + " " + sortColumnDir);             }              recordsTotal = v.Count();             var data = v.Skip(skip).Take(pageSize).ToList();             return Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data }, JsonRequestBehavior.AllowGet);         }     } 

3:

4:

I would suggest ALMMa DataTables.


40 out of 100 based on 20 user ratings 20 reviews