10 examples of 'datatable refresh jquery' in JavaScript

Every line of 'datatable refresh jquery' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
2function refresh(){
3 var table = $('.table').DataTable();
4 table.ajax.reload(null,false);// 刷新表格数据,分页信息不会重置
5}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

7function refreshTableRows(table, data) {
8 var tbody = table.find('tbody');
9 // Clear rows
10 tbody.empty();
11
12 // Append all rows
13 $.each(data, function () {
14 var row = '<tr class="ss-gridfield-item">';
15
16 for (var key in this) {
17 var val = this[key];
18 row += '<td>' + val + '</td>';
19 }
20
21 row += '<td><button class="tablefield-btn-remove">-</button></tr>';
22 tbody.append(row);
23 });
24
25}
163function reloadTable() {
164 $("#libraryTable").DataTable().ajax.reload();
165}
194function refreshTable(){
195 $("table").bootstrapTable('refresh', {
196 url:$("table").attr('data-url')
197 });
198}
39function refreshTable(interval) {
40 table.ajax.reload(null, false);
41 setTimeout(() => refreshTable(interval), 5000);
42}
207function setupDataTable() {
208 var tableOptions;
209 tableOptions = {
210 "bJQueryUI" : true,
211 "sPaginationType" : "full_numbers",
212 "aaData" : [],
213 "aoColumns" : [ {
214 "sTitle" : "Parameter",
215 "sType" : "String",
216 "mData" : "name",
217 "mRender": function(data, type, full) {
218 return data;
219 }
220 }, {
221 "sTitle" : "Value",
222 "sType" : "Numeric",
223 "mData" : "value",
224 "mRender": function(data, type, full) {
225 return data;
226 }
227 }, {
228 "sTitle" : "Received Time",
229 "mData" : "receivedTime",
230 "mRender": function(data, type, full) {
231 return new Date(new Number(data));
232 },
233 "asSorting" : [ "desc" ]
234 } ],
235 "aaSorting" : [ [ 2, "desc" ] ]
236 };
237
238 table = $("#tmTable").dataTable(tableOptions);
239}
61function initDataTables() {
62 $('#personal').dataTable({
63 "sDom": 'rt<"bottom"><"clear">',
64 "aaSorting": [],
65 "bPaginate": false,
66 "bSort": true
67 });
68}
15function update_table(wobj, dt_id) {
16 //console.log("dt_id:", dt_id);
17 //let data = wobj.model.get('data');
18 let cols = wobj.model.get('columns');
19 if(cols=="") return;
20 //console.log("cols:", cols)
21 let columns_ = JSON.parse(cols);
22 //console.log(data)
23 if ( ! $.fn.DataTable.isDataTable( '#'+dt_id ) ) {
24 //console.log("Create DT:"+dt_id);
25 var columns = columns_.map(function(c) { return {"sTitle": c.toString()}; });
26 wobj.data_table = $( '#'+dt_id).DataTable( {
27 "columns": columns,
28 "processing": true,
29 "serverSide": true,
30 //"retrieve": true,
31 "ajax": function (data_, callback, settings) {
32 var js_data = JSON.parse(wobj.model.get('data'));
33 if(js_data.draw < data_.draw) js_data.draw = data_.draw;
34 callback(js_data);
35
36 }}).on( 'page.dt', function () {
37 change_page(wobj);
38 } ).on( 'length.dt', function ( e, settings, len ) {
39 change_page(wobj);
40 });//window.my_table = data_table;
41 } else {
42 //$('#dataframe').dataTable({"retrieve": true}).ajax.reload();
43 wobj.data_table.ajax.reload(null, false);
44 }
45}
48function reloadTable(){
49 $('#resourcetable').flexReload();
50 setTimeout("reloadTable()",5000);
51}
70function initDataTables() {
71 addFilterOnDoneTyping();
72 // Job pairs table
73 pairTable = $('#pairTbl').dataTable({
74 "sDom": getDataTablesDom(),
75 "iDisplayStart": 0,
76 "iDisplayLength": defaultPageSize,
77 "bServerSide": true,
78 "pagingType": "full_numbers",
79
80 "sAjaxSource": starexecRoot + "services/jobs/",
81 "sServerMethod": "POST",
82 "fnServerData": fnPaginationHandler
83 });
84 setSortTable(pairTable);
85 $("#pairTbl thead").click(function() {
86 resetSortButtons();
87 });
88 // Change the filter so that it only queries the server when the user stops typing
89 $('#pairTbl').dataTable().fnFilterOnDoneTyping();
90
91}

Related snippets