You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/rows-API.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Add new row data to the current instance. The `data` parameter must be an `array
19
19
```javascript
20
20
let newRow = ["column1", "column2", "column3", "column4", ...];
21
21
22
-
datatable.rows.add(newRow);
22
+
dataTable.rows.add(newRow);
23
23
24
24
```
25
25
@@ -34,7 +34,7 @@ let newRows = [
34
34
...
35
35
];
36
36
37
-
datatable.insert({data: newRows})
37
+
dataTable.insert({data: newRows})
38
38
```
39
39
40
40
---
@@ -44,7 +44,7 @@ let newRows = [
44
44
Remove existing rows from the current instance. The `select` parameter can either be an `integer` or `array` of `integers` representing the row indexes.
45
45
46
46
```javascript
47
-
let rows =datatable.rows;
47
+
let rows =dataTable.rows;
48
48
49
49
// remove the 6th row
50
50
rows.remove(5);
@@ -61,10 +61,10 @@ For example, if you're trying to remove a row that's unrendered, the `rowIndex`
61
61
Another example would be if you're currently on page 5 and you have `perPage` set to `5` the currently rendered rows have a `rowIndex` of `0`, `1`, `2`, `3` and `4`, respectively, but to remove them you would need to use the indexes `20`, `21`, `22`, `23` and `24`, respectively.
62
62
63
63
```javascript
64
-
let rows =datatable.rows;
64
+
let rows =dataTable.rows;
65
65
66
66
// Switch to page 5
67
-
datatable.page(5);
67
+
dataTable.page(5);
68
68
69
69
// WRONG: removes the first 5 rows on page 1
70
70
rows.remove([0, 1, 2, 3, 4]);
@@ -77,10 +77,10 @@ You can quickly access the correct index for the rendered row by grabbing it's `
77
77
78
78
```javascript
79
79
// Get the first rendered row
80
-
let rowToRemove =datatable.body.querySelector("tr");
80
+
let rowToRemove =dataTable.body.querySelector("tr");
0 commit comments