Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Commit 6cd271a

Browse files
committed
update pre-populating rows demo #58
1 parent 25161ef commit 6cd271a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tutorials/pre-populating.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="example-container clearfix">
44
<p>Below example shows how cell renderers can be used to present the template values for empty rows.
5-
When a cell in the empty row is edited, the <strong>onChange</strong> callback fills the row with the template values.</p>
5+
When a cell in the empty row is edited, the <strong>beforeChange</strong> callback fills the row with the template values.</p>
66

77
<div data-jsfiddle="example1">
88
<div id="example1" class="hot"></div>
@@ -33,7 +33,7 @@
3333
hot1;
3434

3535
function isEmptyRow(instance, row) {
36-
var rowData = instance.getData()[row];
36+
var rowData = instance.countRows();
3737

3838
for (var i = 0, ilen = rowData.length; i < ilen; i++) {
3939
if (rowData[i] !== null) {
@@ -72,7 +72,7 @@
7272
beforeChange: function (changes) {
7373
var instance = hot1,
7474
ilen = changes.length,
75-
clen = instance.colCount,
75+
clen = instance.countCols(),
7676
rowColumnSeen = {},
7777
rowsToFill = {},
7878
i,
@@ -112,4 +112,3 @@
112112
</a>
113113
</p>
114114
</div>
115-

0 commit comments

Comments
 (0)