Skip to content

Commit 61ef2bd

Browse files
prevent jitter in the table while editing
1 parent 6e5ec9b commit 61ef2bd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

js/frame.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,7 @@
515515
} );
516516
}
517517

518-
$.extend( $.fn.dataTable.defaults, settings );
519-
var $table = $(element + ' .viz-editor-table').DataTable();
518+
var $table = $(element + ' .viz-editor-table').DataTable(settings);
520519
return $table;
521520
}
522521

js/render-datatables.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
}
158158
}
159159
$.extend( settings, additional );
160-
$.extend( $.fn.dataTable.defaults, settings );
161160

162161
cols = [];
163162
for (j = 0; j < series.length; j++) {
@@ -192,16 +191,18 @@
192191
rows.push(row);
193192
}
194193

195-
// allow user to extend the settings.
196-
$('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings});
197-
198-
table = $('#' + id + ' table.visualizer-data-table');
199-
table.DataTable( {
194+
$.extend( settings, {
200195
data: rows,
201196
columns: cols,
202197
stripeClasses: stripe,
203198
} );
204199

200+
// allow user to extend the settings.
201+
$('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings});
202+
203+
table = $('#' + id + ' table.visualizer-data-table');
204+
table.DataTable( settings );
205+
205206
// header row is handled here as the class is added dynamically to it (after the table is rendered).
206207
if(typeof chart.settings['cssClassNames'] !== 'undefined'){
207208
if(typeof chart.settings['cssClassNames']['headerRow'] !== 'undefined'){

0 commit comments

Comments
 (0)