@manhng

Welcome to my blog!

jQuery DataTables Summary

June 3, 2021 13:29

jQuery DataTables Summary (edit)

http://www.ville-pont-eveque.fr/tools/library/DataTables/examples/data_sources/js_array.html

https://manhng.com/blog/scrud/

https://manhng.com/blog/jquery-datatables-event-prexhr/

https://manhng.com/blog/datatables-editable/

https://manhng.com/blog/jquery-datatables/

https://manhng.com/blog/jquery-datatables-ajax/

https://manhng.com/blog/jquery-datatables-server-side-stored-procedure/

https://manhng.com/blog/jquery-datatables-in-net-core/

https://manhng.com/blog/reactjs/

https://manhng.com/blog/jquery-datatables-server-side-processing/

https://manhng.com/archive/jquery-datatables-server-side-processing/

https://manhng.com/blog/datatables-ajax/

https://manhng.com/blog/mvc-best-practices/

https://manhng.com/blog/jquery-usage/

https://manhng.com/blog/export-excel-js/

https://manhng.com/blog/systems-architecture/

CRUD Automatically Add Table TD, TR

https://www.codemag.com/Article/1511031/CRUD-in-HTML-JavaScript-and-jQuery

Realtime jQuery Datatable with Pusher

https://github.com/christiannwamba/pusher-realtime-jquery-datatable/

https://material.io/components/data-tables

https://www.c-sharpcorner.com/article/create-datatable-in-jquery/

https://techgrafitti.wordpress.com/2014/11/18/jquery-datatables-empty-table-custom-text-clear-datatable-search-columns/

Getting Started

https://www.aspsnippets.com/Articles/Simple-jQuery-DataTables-Tutorial-with-example-in-ASPNet.aspx

https://www.c-sharpcorner.com/article/display-data-in-Asp-Net-using-jquery-datatables-plugin/

https://www.c-sharpcorner.com/article/using-jquery-datatables-grid-with-asp-net-core-mvc/

https://www.c-sharpcorner.com/article/using-datatables-grid-with-asp-net-mvc/

Source (Server)

DTO Item class

 public class JsonData
{
public int draw { get; set; }
public int recordsFiltered { get; set; }
public int recordsTotal { get; set; }
public List<Item> data { get; set; }

public JsonData()
{
draw = 1;
recordsFiltered = 0;
recordsTotal = 0;
data = new List<Item>();
}
}

XML Data ~ Array or List of DTO (Item class)

<Data><Items><Item><UserType>{0}</UserType><DocType>{1}</DocType><OrderCode>{2}</OrderCode><Phase>{3}</Phase><Namespace>{4}</Namespace><Type>{5}</Type><Method>{6}</Method><MethodTitle>{7}</MethodTitle><Mean>{8}</Mean><Dtn>{9}</Dtn></Item></Items></Data>

Source (Client)

https://manhng.com/blog/jquery-datatables-event-prexhr/

https://manhng.com/blog/jquery-datatables-ajax/

https://www.c-sharpcorner.com/article/using-jquery-datatables-grid-with-asp-net-core-mvc/

Html

<body>
<div class="datatable-statistic">
<table id="demoGrid" class="table table-striped table-bordered dt-responsive nowrap" width="100%" cellspacing="0">
<thead>
<tr>
<th>UserType</th>
<th>DocType</th>
<th>OrderCode</th>
<th>Phase</th>
<th>Namespace</th>
<th>Type</th>
<th>Method</th>
<th>MethodTitle</th>
<th>Mean</th>
<th>Execution time</th>
</tr>
</thead>
</table>
</div>
</body>

CSS & CDN

<link href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.bootstrap.min.css" rel="stylesheet" />

<style>
.datatable-statistic {
margin: 10px;
}

#demoGrid td:nth-child(8),
#demoGrid th:nth-child(8) {
font-weight: bold;
}
</style>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap4.min.js"></script>

JavaScript

<script>
$(document).ready(function () {
var table = $("#demoGrid").DataTable({
"processing": true, // for show progress bar
"serverSide": true, // for process server side
"filter": true, // this is for disable filter (search box)
"orderMulti": false, // for disable multiple column at once
"pageLength": 20,
"ajax": {
"url": "/Home/LoadData",
"type": "POST",
"datatype": "json"
},
"columnDefs":
[{
"targets": [0],
"visible": false,
"searchable": false
},
{
"targets": [1],
"searchable": false,
"orderable": false
},
{
"targets": [2],
"searchable": true,
"orderable": true
},
{
"targets": [3],
"searchable": true,
"orderable": true
},
{
"targets": [4],
"searchable": true,
"orderable": true
},
{
"targets": [5],
"searchable": true,
"orderable": true
},
{
"targets": [6],
"searchable": true,
"orderable": true
},
{
"targets": [7],
"searchable": true,
"orderable": true
},
{
"targets": [8],
"searchable": true,
"orderable": true
},
{
"targets": [9],
"searchable": true,
"orderable": true
}],
"columns": [
{ "data": "UserType", "name": "UserType", "autoWidth": true },
{ "data": "DocType", "name": "DocType", "autoWidth": true },
{ "data": "OrderCode", "title": "OrderCode", "name": "OrderCode", "autoWidth": true },
{ "data": "Phase", "name": "Phase", "autoWidth": true },
{ "data": "Namespace", "name": "Namespace", "autoWidth": true },
{ "data": "Type", "name": "Type", "autoWidth": true },
{ "data": "Method", "name": "Method", "autoWidth": true },
{ "data": "MethodTitle", "name": "MethodTitle", "title": "MethodTitle", "autoWidth": true },
{ "data": "Mean", "name": "Mean", "title": "Mean", "autoWidth": true },
{ "data": "Dtn", "name": "Dtn", "title": "Execution time", "autoWidth": true }
]

});
table.on('preXhr.dt', function (e, settings, data) {
//Before send Ajax
console.log('preXhr.dt');
});
table.on('xhr.dt', function (e, settings, json) {
//After send Ajax
console.log('xhr.dt');
});
table.on('xhr', function () {
var json = table.ajax.json();
console.log('xhr');
console.log(json.data.length + ' row(s) were loaded');
});
});

</script>

CRUD PHP + jQuery Datatables

August 12, 2020 15:58

CRUD PHP + jQuery Datatables (edit)

http://phpnewspot.blogspot.com/2016/06/how-to-make-crud-operations-by-using.html

https://webdamn.com/datatables-add-edit-delete-with-ajax-php-mysql/

https://webdamn.com/datatables-add-edit-delete-with-codeigniter/

https://webdamn.com/crud-operation-in-codeigniter/

https://www.webslesson.info/2017/01/php-pdo-ajax-crud-with-data-tables-and-bootstrap-modals.html

https://www.webslesson.info/2017/12/comments-system-using-php-and-ajax.html

https://learncodeweb.com/php/php-crud-in-bootstrap-4-with-search-functionality/

https://learncodeweb.com/demo/php/php-crud-in-bootstrap-4-with-search-functionality/add-users.php

https://seegatesite.com/create-simple-crud-with-datatables-jquery-and-adminlte/

https://makitweb.com/edit-delete-datatables-record-with-ajax-and-php/

https://webdamn.com/school-management-system-with-php-mysql/

Update multiple rows

https://www.webslesson.info/2018/09/update-multiple-rows-with-checkbox-in-php-using-ajax-jquery.html

jQuery DataTables Event Prexhr

June 12, 2020 14:29

Ajax event - fired before an Ajax request is made (edit)

https://datatables.net/reference/event/preXhr

https://nunofpjacinto.wordpress.com/jquery-datatable/

https://dotblogs.com.tw/shadow/2018/04/03/060340 (HAY)

https://www.manongdao.com/article-96869.html (HAY)

$('.table').on('preXhr.dt', function(e, settings, data){
    ...
});

table = $('#tblProjectList').on('preXhr.dt', function (e, settings, data) {
data.ID = $("#dropdownOrganization").val();
data.StartDate = $("#datepicker-startdate").val();
data.EndDate = $("#datepicker-enddate").val();
console.log('preXhr', data);
console.log('preXhr.dt', data);
}).DataTable({
"ajax": {
"type": "GET",
"url": window.UrlActionGetDataSearchProject,
"datatype": "JSON",
},
"processing": true,
...

https://datatables.net/forums/discussion/33598/prexhr-dt-not-fired-on-first-ajax-request-after-page-load

https://stackoverflow.com/questions/31475497/jquery-datatables-event-prexhr-dt-doesnt-fire


$
('table').on('preXhr.dt', function(e, settings, data){
$('#<table-id>').on('preXhr.dt', function(e, settings, data){
$('.<table-class>').on('preXhr.dt', function(e, settings, data){
$(document).ready(function() {
  $('#tableId').on('preXhr.dt', function ( e, settings, data ) {
    // before ajax call 
    ...
  } ).on('xhr.dt', function ( e, settings, json ) {
    // after ajax call 
    ...
  } ).dataTable( {
    "processing": true,
    "serverSide": true,
    "ajax": { 
        "url": "/server_processing/",
        "data": function(data){
            return "param="+JSON.stringify(data); 
        }
    }
  });
});

ReactJS + jQuery DataTables

April 13, 2020 21:13

ReactJS (edit)

Resume_Builder is an application which allows you to create resumes. The application is developed using ReactJs and Bootstrap 4

https://github.com/Tsudhishnair/Resume_Builder

Contacts is basically a contact list where one can see there contactlist, add new contacts and search them. This application is build using ReactJs and uses Firebase Realtime Database for storing the contact details.

https://github.com/Tsudhishnair/ContactApp

Stored Procedure & jQuery DataTables

https://cdn.datatables.net/releases.html

https://cdn.datatables.net/1.9.4/  

$('#example').dataTable();

https://cdn.datatables.net/1.10.20/

$('#example').DataTable();

https://docs.microsoft.com/en-us/aspnet/ajax/cdn/jquery-datatables/cdnjquerydatatables194 (1.9.4)

https://docs.microsoft.com/en-us/aspnet/ajax/cdn/jquery-datatables/cdnjquerydatatables105 (1.10.5)

jQuery Datatable Using SQL Server Stored Procedure with dynamic and efficient paging structures (supports all server versions)

https://stackoverflow.com/questions/13677914/using-datatables-with-asp-net-c-sharp-linq-and-stored-procedure-having-pager (HAY HAY HAY)

https://stackoverflow.com/questions/39318753/cant-make-datatables-pagination-with-stored-procedure-in-mvc5

http://developmentpassion.blogspot.com/2016/08/grid-view-with-server-side-filtering.html (HAY HAY HAY)

DataTable With Pagination Concept

https://datatables.net/forums/discussion/34800/jquery-datatables-losing-reference-on-pagination

https://www.c-sharpcorner.com/forums/how-to-create-pagination-like-jquery-datatable

https://www.sitepoint.com/working-jquery-datatables/ (HAY HAY HAY)

How to call MVC Action using Jquery AJAX and then submit form in MVC?

https://stackoverflow.com/questions/25068431/how-to-call-mvc-action-using-jquery-ajax-and-then-submit-form-in-mvc/ (HAY HAY HAY)

https://stackoverflow.com/questions/56447567/how-to-call-stored-procedure-while-using-jquery-data-tables

https://entityframework.net/knowledge-base/56447567/how-to-call-stored-procedure-while-using-jquery-data-tables

CRUD: https://www.c-sharpcorner.com/article/using-datatables-grid-with-asp-net-mvc/

Create Dynamic HTML Table in JavaScript

https://www.encodedna.com/javascript/populate-json-data-to-html-table-using-javascript.htm

https://www.encodedna.com/javascript/dynamically-create-html-elements-using-createElement-method.htm

https://www.encodedna.com/javascript/dynamically-add-remove-rows-to-html-table-using-javascript-and-save-data.htm

https://www.encodedna.com/javascript/how-to-read-data-from-html-table-using-javascript.htm

JavaScript Framework

https://sfdcmonkey.com/2018/10/22/data-table-pagination-checkbox-lightning/

Bulma: CSS Framework using Flexbox

https://github.com/jgthms/bulma

jQuery DataTables (Good Examples)

August 7, 2019 17:57

jQuery DataTables (Good Examples) (edit)

https://gist.github.com/manhnguyenv/497b999242244d8caeb9a71dc5e122cd

https://github.com/manhnguyenv/JqueryDataTables

Log with log4net + NLog

https://www.codeproject.com/Articles/1278018/Best-Logging-libraries-for-ASP-NET-MVC

https://www.codeproject.com/Articles/104112/Log-Reporting-Dashboard-for-ASP-NET-MVC

Exceptions

https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions

https://stackify.com/beyond-iis-logs-find-failed-iis-asp-net-requests/

http://hamidmosalla.com/2018/02/28/net-exception-best-practices/

https://stackify.com/what-is-structured-logging-and-why-developers-need-it/

https://dzone.com/articles/c-exception-handling-best-practices

Client side HTML encoding and decoding

https://www.strictly-software.com/htmlencode/

https://gomakethings.com/preventing-cross-site-scripting-attacks-when-using-innerhtml-in-vanilla-javascript/

https://www.checkmarx.com/2017/10/09/3-ways-prevent-xss/

https://www.acunetix.com/websitesecurity/cross-site-scripting/

https://devnet.kentico.com/articles/security-avoiding-cross-site-scripting-(xss)

https://docs.kentico.com/k8/securing-websites/developing-secure-websites/cross-site-scripting-xss

Refer

https://gist.github.com/OllieJones/7448933cc85ee740e990383e4fded412

https://www.plumislandmedia.net/reference/datatables-net-nice-way-display-lots-data-web-page/

http://modules.processwire.com/modules/jquery-data-tables/

jQuery Datatables Checkboxes

December 6, 2018 23:16

jQuery Datatables with Checkboxes (edit)

https://github.com/DataTables/DataTables

http://www.compilemode.com/

http://ezzylearning.com/

https://chsakell.com/2013/08/24/retrieving-data-with-dbcontext/

https://chsakell.com/2013/08/17/stored-procedures-views-and-transactions-with-code-first-entity-framework/

https://www.c-sharpcorner.com/csharp-tutorials/

https://www.c-sharpcorner.com/blogs/server-side-pagination-and-searching-with-datatable-and-asp-net-mvc

https://datatables.net/forums/discussion/40690/sample-implementation-of-serverside-processing-in-c-mvc-ef-with-paging-sorting-searching

http://www.ed8tor.datatables.net/forums/discussion/40690/sample-implementation-of-serverside-processing-in-c-mvc-ef-with-paging-sorting-searching

https://datatables.net/forums/discussion/31221/how-do-i-make-datatables-redraw-a-server-side-table-and-maintain-the-current-search-and-page-length

http://datatables3.rssing.com/chan-5199417/all_p1763.html

https://blog.webnersolutions.com/preserving-checkbox-state-in-jquery-datatable-with-pagination

https://www.guru99.com/c-sharp-access-database.html

jquery datatables

March 26, 2018 09:53

jQuery DataTables

https://www.codeproject.com/Articles/155422/jQuery-DataTables-and-ASP-NET-MVC-Integration-Part

https://levelnis.co.uk/blog/datatables-with-web-api-part-3-paging-sorting-searching

https://amoerie.com/2013/03/08/a-generic-approach-to-data-tables-with-server-side-processing/

https://gist.github.com/dharmesh93/1e9b6d54b664ed9c5c7122df83654267

http://ezzylearning.com/tutorial/using-jquery-datatables-with-asp-net-web-api

http://www.compilemode.com/2016/03/paging-sorting-and-searching-in-asp-net-mvc-using-jQuery-DataTable.html?m=1

https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application

Web Security

https://www.codeproject.com/Articles/1224635/Custom-Authentication-and-Authorization-in-Asp-N

https://www.codeproject.com/Articles/1185880/ASP-NET-Core-WebAPI-secured-using-OAuth-Client-Cre

https://www.codeproject.com/Articles/1183421/Simple-OAuth-Authorization-Server-with-Identity-Se

Categories

Recent posts