-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_table.html
20 lines (17 loc) · 1017 Bytes
/
test_table.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<button onclick="x.updateRow(fuckingrow);">Insert</button>
<button onclick="x.removeRow(fuckingrow);">Remove</button>
<script src="ejui/table.js"></script>
<script>
/* AnimatedTable public API
new AnimatedTable(column_list);
AnimatedTable.prototype.updateRow(rowObject);
AnimatedTable.prototype.removeRow(rowObject);
column_list must be an array of objects with string fields "id" and "name"
rowObject must be an object with an integral "id" field (unique row ID) and string fields corresponding to some of the columns
A single row must always be referenced by the same rowObject, even if it is deleted and recreated, unless a user-specified rowObject._onremove callback has been called.
TODO: update documentation and the test to reflect the current state */
x = new AnimatedTable([{id: "test", name: "Test column"}, {id: "test2", name: "Another test column"}]);
document.documentElement.appendChild(x.theTable);
x.theTable.border = 1;
fuckingrow = {id: 1, test: "Test data #1", test2: "Test data #2"};
</script>