Skip to content

Commit 8112fca

Browse files
authored
Merge pull request #407 from bubbletroubles/patch-1
Docs: Fixed case - `datatable` to `dataTable`
2 parents ea521fe + ec15136 commit 8112fca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/documentation/rows-API.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Add new row data to the current instance. The `data` parameter must be an `array
1919
```javascript
2020
let newRow = ["column1", "column2", "column3", "column4", ...];
2121

22-
datatable.rows.add(newRow);
22+
dataTable.rows.add(newRow);
2323

2424
```
2525

@@ -34,7 +34,7 @@ let newRows = [
3434
...
3535
];
3636

37-
datatable.insert({data: newRows})
37+
dataTable.insert({data: newRows})
3838
```
3939

4040
---
@@ -44,7 +44,7 @@ let newRows = [
4444
Remove existing rows from the current instance. The `select` parameter can either be an `integer` or `array` of `integers` representing the row indexes.
4545

4646
```javascript
47-
let rows = datatable.rows;
47+
let rows = dataTable.rows;
4848

4949
// remove the 6th row
5050
rows.remove(5);
@@ -61,10 +61,10 @@ For example, if you're trying to remove a row that's unrendered, the `rowIndex`
6161
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.
6262

6363
```javascript
64-
let rows = datatable.rows;
64+
let rows = dataTable.rows;
6565

6666
// Switch to page 5
67-
datatable.page(5);
67+
dataTable.page(5);
6868

6969
// WRONG: removes the first 5 rows on page 1
7070
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 `
7777

7878
```javascript
7979
// Get the first rendered row
80-
let rowToRemove = datatable.body.querySelector("tr");
80+
let rowToRemove = dataTable.body.querySelector("tr");
8181

8282
// Remove it
83-
datatable.rows.remove(parseInt(rowToRemove.dataset.index));
83+
dataTable.rows.remove(parseInt(rowToRemove.dataset.index));
8484

8585
```
8686

0 commit comments

Comments
 (0)