@manhng

Welcome to my blog!

jQuery DataTables with Ajax

March 23, 2020 16:46

jQuery DataTables with Ajax (edit)

Google with keywords: "xhr.dt" + "preXhr.dt" + "ajax" site:datatables.net

Help: https://datatables.net/faqs/index

Template: https://jsfiddle.net/63235xk2/

Documentation: https://stackoverflow.com/questions/25207147/datatable-vs-datatable-why-is-there-a-difference-and-how-do-i-make-them-w

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

https://legacy.datatables.net/

https://cdn.datatables.net/

https://github.com/fingers10/JqueryDataTablesServerSide/ (.NET Core)

https://datatables.net/examples/ajax/objects.html

$(document).ready(function() {
$('#example').DataTable( {
"ajax": "data/objects.txt",
"columns": [
{ "data": "name" },
{ "data": "position" },
{ "data": "office" },
{ "data": "extn" },
{ "data": "start_date" },
{ "data": "salary" }
]
});
});

https://datatables.net/reference/option/ajax

Đa ngôn ngữ: Tiếng Việt

https://viblo.asia/p/tim-hieu-datatable-E375z8ObZGW

CSS

https://mdbootstrap.com/docs/jquery/tables/datatables/

Ajax + Json (HAY HAY HAY)

https://datatables.net/reference/api/ajax.json()

var table = $('#example').DataTable( {
ajax: "data.json"
});

table.on( 'xhr', function () {
var json = table.ajax.json();
alert( json.data.length +' row(s) were loaded' );
});

initComplete

https://datatables.net/forums/discussion/55764/ajax-reload-callback-function-doesnt-wait-until-xhr-completes

https://stackoverflow.com/questions/56346220/in-datatable-initcomplete-not-called-after-table-ajax-reload

https://stackoverflow.com/questions/33344982/jquery-datatables-resume-after-ajax-call-completed

https://datatables.net/forums/discussion/44312/call-the-same-function-for-initcomplete-and-reload (HAY HAY HAY)

function initCompleteFunction(settings, json){
var api = new $.fn.dataTable.Api( settings );
// ... skipped ...
}

$(document).ready(function(){
$('#matable').on('xhr.dt', function ( e, settings, json, xhr ) {
initCompleteFunction(settings, json);
} );

var tableDONNEES = $("#matable").DataTable( {
// ... skipped ...
});
});

https://datatables.net/forums/discussion/21096/initcomplete-table-reload

https://datatables.net/reference/option/initComplete

https://datatables.net/forums/discussion/44647/initcomplete-function-not-working-in-datatable

https://datatables.net/forums/discussion/34602/using-initcomplete

https://datatables.net/forums/discussion/34352/passing-datatable-object-to-initcomplete-callback

https://datatables.net/examples/api/api_in_init.html

https://stackoverflow.com/questions/15786572/call-a-function-in-success-of-datatable-ajax-call

StateSave

https://www.sitepoint.com/working-jquery-datatables/

AutoRefresh

https://datatables.net/reference/api/ajax.reload()

https://stackoverflow.com/questions/12934144/how-to-reload-refresh-jquery-datatable

https://recalll.co/ask/v/topic/javascript-How-to-reloadrefresh-jQuery-dataTable/59fdeb961126f4991c8b7362

https://exceptionshub.com/how-to-reloadrefresh-jquery-datatable-2.html

https://bugsdb.com/_en/debug/06861687c29d8198c5a7609008fdd28b

Show Hide Columns

https://makitweb.com/dynamically-show-hide-columns-in-datatable-ajax-pagination/

Add new row

https://pusher.com/tutorials/realtime-table-datatables

Checkbox column

https://www.gyrocode.com/articles/jquery-datatables-how-to-add-a-checkbox-column/

Column search

https://phppot.com/php/column-search-in-datatables-using-server-side-processing/

DataTable with Java

https://mobisoftinfotech.com/resources/blog/web-programming/jquery-datatable-ajax-tutorial-with-example-project/

DataTable with Wordpress

https://itsmereal.com/datatables-server-side-processing-in-wordpress/

DataTable old version

https://www.codeproject.com/Articles/194916/Enhancing-HTML-tables-using-a-JQuery-DataTables-pl

ASP.NET Web Services

https://cmatskas.com/server-side-jquery-datatables-with-asp-net/

Good Article

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

Categories

Recent posts