UNPKG

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