UNPKG

803 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6/**
7 * Module : kero dataTable getCurrent
8 * Author : liuyk(liuyk@yonyou.com)
9 * Date : 2016-08-08 09:59:01
10 */
11
12/**
13 * 获取当前操作行
14 * 规则: focus 行优先,没有focus行时,取第一选中行
15 */
16var getCurrentRow = function getCurrentRow() {
17 if (this.focusIndex() != -1) return this.getFocusRow();
18 var index = this.getSelectedIndex();
19 if (index == -1) return null;else return this.getRow(index);
20};
21
22var getCurrentIndex = function getCurrentIndex() {
23 if (this.focusIndex() != -1) return this.focusIndex();
24 var index = this.getSelectedIndex();
25 if (index == -1) return -1;else return index;
26};
27
28exports.getCurrentRow = getCurrentRow;
29exports.getCurrentIndex = getCurrentIndex;
\No newline at end of file