Skip to content

Commit e256bc9

Browse files
committed
Updated example3 to include adding new items.
1 parent 4505a94 commit e256bc9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/example3-editing.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h2>Options:</h2>
7272

7373
var options = {
7474
editable: true,
75-
enableAddRow: false,
75+
enableAddRow: true,
7676
enableCellNavigation: true,
7777
asyncEditorLoading: false
7878
};
@@ -95,6 +95,13 @@ <h2>Options:</h2>
9595

9696

9797
grid = new Slick.Grid($("#myGrid"), data, columns, options);
98+
99+
grid.onAddNewRow = function(item,colDef) {
100+
grid.removeRow(data.length);
101+
data.push(item);
102+
grid.updateRowCount();
103+
grid.render();
104+
}
98105
})
99106

100107
</script>

0 commit comments

Comments
 (0)