@@ -734,7 +734,17 @@ return /******/ (function(modules) { // webpackBootstrap
734734 if (this.store.filterObj) this.handleFilterData(this.store.filterObj);
735735 newState.currPage = _util2.default.getFirstPage(nextProps.options.pageStartIndex);
736736 } else {
737- data = this.store.sort().get();
737+ if (!this.allowRemote(_Const2.default.REMOTE_SORT)) {
738+ data = this.store.sort().get();
739+ } else {
740+ var currentOptions = this.props.options;
741+
742+ var sortName = options.sortName;
743+ var sortOrder = options.sortOrder;
744+ if (currentOptions.sortName !== sortName || currentOptions.sortOrder !== sortOrder) {
745+ this.store.setSortInfo(sortOrder, options.sortName);
746+ }
747+ }
738748 newState.data = data;
739749 }
740750 this.setState(function () {
@@ -748,9 +758,9 @@ return /******/ (function(modules) { // webpackBootstrap
748758 }
749759 var sortList = this.store.getSortInfo();
750760 var sortField = options.sortName;
751- var sortOrder = options.sortOrder;
752- if (sortField && sortOrder ) {
753- this.store.setSortInfo(sortOrder , sortField);
761+ var _sortOrder = options.sortOrder;
762+ if (sortField && _sortOrder ) {
763+ this.store.setSortInfo(_sortOrder , sortField);
754764 this.store.sort();
755765 } else if (sortList.length > 0) {
756766 this.store.sort();
@@ -1425,7 +1435,8 @@ return /******/ (function(modules) { // webpackBootstrap
14251435 invalid();
14261436 }
14271437 };
1428- var isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB);
1438+ var props = { rowIndex: rowIndex, colIndex: colIndex };
1439+ var isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB, props);
14291440 if (isValid === false && typeof isValid !== 'undefined') {
14301441 return invalid();
14311442 } else if (isValid === _Const2.default.AWAIT_BEFORE_CELL_EDIT) {
@@ -1443,13 +1454,14 @@ return /******/ (function(modules) { // webpackBootstrap
14431454
14441455 var columns = this.getColumnsDescription(this.props);
14451456 var fieldName = columns[colIndex].name;
1457+ var props = { rowIndex: rowIndex, colIndex: colIndex };
14461458 if (onCellEdit) {
14471459 newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal);
14481460 }
14491461
14501462 if (this.allowRemote(_Const2.default.REMOTE_CELL_EDIT)) {
14511463 if (afterSaveCell) {
1452- afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
1464+ afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props );
14531465 }
14541466 return;
14551467 }
@@ -1463,7 +1475,7 @@ return /******/ (function(modules) { // webpackBootstrap
14631475 });
14641476
14651477 if (afterSaveCell) {
1466- afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
1478+ afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props );
14671479 }
14681480 }
14691481 }, {
@@ -7459,7 +7471,8 @@ return /******/ (function(modules) { // webpackBootstrap
74597471 var _props2 = this.props,
74607472 keyBoardNav = _props2.keyBoardNav,
74617473 onNavigateCell = _props2.onNavigateCell,
7462- cellEdit = _props2.cellEdit;
7474+ cellEdit = _props2.cellEdit,
7475+ selectedRowKeys = _props2.selectedRowKeys;
74637476
74647477 var offset = void 0;
74657478 if (e.keyCode === 37) {
@@ -7476,16 +7489,23 @@ return /******/ (function(modules) { // webpackBootstrap
74767489 } else if (e.keyCode === 40) {
74777490 offset = { x: 0, y: 1 };
74787491 } else if (e.keyCode === 13) {
7492+ var rowIndex = e.target.parentElement.rowIndex + 1;
74797493 var enterToEdit = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToEdit : false;
74807494 var enterToExpand = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToExpand : false;
7495+ var enterToSelect = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToSelect : false;
74817496
74827497 if (cellEdit && enterToEdit) {
7483- this.handleEditCell(e.target.parentElement. rowIndex + 1 , e.currentTarget.cellIndex, '', e);
7498+ this.handleEditCell(rowIndex, e.currentTarget.cellIndex, '', e);
74847499 }
74857500
74867501 if (enterToExpand) {
74877502 this.handleClickCell(this.props.y + 1, this.props.x);
74887503 }
7504+
7505+ if (enterToSelect) {
7506+ var isSelected = selectedRowKeys.indexOf(this.props.data[rowIndex - 1][this.props.keyField]) !== -1;
7507+ this.handleSelectRow(rowIndex, !isSelected, e);
7508+ }
74897509 }
74907510 if (offset && keyBoardNav) {
74917511 onNavigateCell(offset);
0 commit comments