clear the table on user clicks

This commit is contained in:
ansuz
2016-07-20 12:23:41 +02:00
parent 64f030c344
commit 2f2ab4392c

View File

@@ -25,7 +25,10 @@ define([
var table = W.table = Table($table, xy); var table = W.table = Table($table, xy);
W.cleanup = function () { W.cleanup = function () {
// TODO reset table to fresh state $table.find('tbody tr').remove();
$table.find('thead th').remove();
//table.rows.forEach(table.removeRow);
//table.cols.forEach(table.removeColumn);
}; };
W.show = function () { W.show = function () {
@@ -139,6 +142,9 @@ define([
var $toolbar = $('#modal-toolbar'); var $toolbar = $('#modal-toolbar');
var $getOptions = W.$getOptions = $('#get-options'); var $getOptions = W.$getOptions = $('#get-options');
var $clearTable = W.$clearTable = ($('#clear-table').click(function () {
W.cleanup();
}));
return W; return W;
}); });