kero
Version:
<img src="http://tinper.org/assets/images/kero.png" width="120" style="max-width:100%;"/>
26 lines (21 loc) • 732 B
JavaScript
/***
* Module : kero dataTable rowCurrent
* Author : liuyk(liuyk@yonyou.com)
* Date : 2016-08-08 09:59:01
*/
// 更新当前行对应索引
const updateCurrIndex = function() {
var currentIndex = this.focusIndex() != -1 ? this.focusIndex() : this.getSelectedIndex();
if (this._oldCurrentIndex != currentIndex) {
this._oldCurrentIndex = currentIndex;
this.trigger(DataTable.ON_CURRENT_ROW_CHANGE)
this.currentRowChange(-this.currentRowChange());
if (this.ns) {
if (this.root.valueChange[this.ns])
this.root.valueChange[this.ns](-this.root.valueChange[this.ns]());
}
}
}
export const rowCurrentFunObj = {
updateCurrIndex: updateCurrIndex
}