6 examples of 'how to reinitialize datatable' in JavaScript

Every line of 'how to reinitialize datatable' 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
163function reloadTable() {
164 $("#libraryTable").DataTable().ajax.reload();
165}
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

34initialize(): void {
35 super.initialize();
36
37 if (this.view.source == null) {
38 this.view.source = this.source;
39 this.view.compute_indices();
40 }
41}
97reloadTable() {
98 this.$groupTable
99 .DataTable()
100 .clear()
101 .draw();
102}
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}
15_initialize() {
16 var _url = this.props.options.url.concat("?",
17 $.param(this.props.options.params));
18 $.get(_url,
19 function(result){
20 this.setState({columns: result.columns});
21 var options = this.props.options.table_options;
22 options.data = result.data;
23 options.columns = result.columns;
24 options.aaData = result.data;
25 if("columnDefs" in this.props.options.table_options){
26 options.columnDefs = this.props.options.table_options.columnDefs;
27 options.columnDefs.forEach(function(x){
28 x.render = new Function("return '" + x.render + "';");
29 });
30 }
31
32 options.initComplete = new Function("settings", "json",
33 this.props.options.table_options.initComplete);
34 options.drawCallback = new Function("settings",
35 this.props.options.table_options.drawCallback);
36 $('#'.concat(this.props.options.id)).dataTable(options);
37 }.bind(this)
38 );
39}
108function initThisPage() {
109 $.fn.DataTable.ext.pager.numbers_length = 5;
110 $('#manage_comic').dataTable( {
111 "destroy": true,
112 "sDom": '<"clear"f><"clear"lp><"clear">rt<"clear"ip>',
113 "deferRender": true,
114 "columnDefs": [
115 { 'bSortable': false, 'aTargets': [ 0, 1 ] },
116 { 'order': [[2, 'desc'],[3, 'desc']] }
117 ],
118 "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, 'All' ]],
119 "language": {
120 "lengthMenu":"Show _MENU_ results per page",
121 "emptyTable": "No results",
122 "info":"Showing _START_ to _END_ of _TOTAL_ results",
123 "infoEmpty":"Showing 0 to 0 of 0 results",
124 "infoFiltered":"(filtered from _MAX_ total results)",
125 "search" : ""},
126 "stateSave": true,
127 "pageLength": 25,
128 "pagingType": "simple_numbers"
129 });
130 resetFilters("comic");
131}

Related snippets