UNPKG

516 BJavaScriptView Raw
1/**
2 * Module : kero dataTable copyRow
3 * Author : liuyk(liuyk@yonyou.com)
4 * Date : 2016-08-01 14:34:01
5 */
6
7
8const copyRow = function (index, row) {
9 this.copyRows(index, [row])
10}
11
12const 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
22export {
23 copyRow,
24 copyRows
25}
\No newline at end of file