1 | /**
|
2 | * Module : kero dataTable copyRow
|
3 | * Author : liuyk(liuyk@yonyou.com)
|
4 | * Date : 2016-08-01 14:34:01
|
5 | */
|
6 |
|
7 |
|
8 | const copyRow = function (index, row) {
|
9 | this.copyRows(index, [row])
|
10 | }
|
11 |
|
12 | const copyRows = function (index, rows) {
|
13 | for(var i=0;i < rows.length;i++) {
|
14 | var newRow = new Row({parent: this})
|
15 | if (rows[i]) {
|
16 | newRow.setData(rows[i].getData())
|
17 | }
|
18 | this.insertRows(index === undefined ? this.rows().length : index, [newRow])
|
19 | }
|
20 | }
|
21 |
|
22 | export {
|
23 | copyRow,
|
24 | copyRows
|
25 | } |
\ | No newline at end of file |