@@ -734,7 +734,17 @@ return /******/ (function(modules) { // webpackBootstrap
734
734
if (this.store.filterObj) this.handleFilterData(this.store.filterObj);
735
735
newState.currPage = _util2.default.getFirstPage(nextProps.options.pageStartIndex);
736
736
} 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
+ }
738
748
newState.data = data;
739
749
}
740
750
this.setState(function () {
@@ -748,9 +758,9 @@ return /******/ (function(modules) { // webpackBootstrap
748
758
}
749
759
var sortList = this.store.getSortInfo();
750
760
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);
754
764
this.store.sort();
755
765
} else if (sortList.length > 0) {
756
766
this.store.sort();
@@ -1425,7 +1435,8 @@ return /******/ (function(modules) { // webpackBootstrap
1425
1435
invalid();
1426
1436
}
1427
1437
};
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);
1429
1440
if (isValid === false && typeof isValid !== 'undefined') {
1430
1441
return invalid();
1431
1442
} else if (isValid === _Const2.default.AWAIT_BEFORE_CELL_EDIT) {
@@ -1443,13 +1454,14 @@ return /******/ (function(modules) { // webpackBootstrap
1443
1454
1444
1455
var columns = this.getColumnsDescription(this.props);
1445
1456
var fieldName = columns[colIndex].name;
1457
+ var props = { rowIndex: rowIndex, colIndex: colIndex };
1446
1458
if (onCellEdit) {
1447
1459
newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal);
1448
1460
}
1449
1461
1450
1462
if (this.allowRemote(_Const2.default.REMOTE_CELL_EDIT)) {
1451
1463
if (afterSaveCell) {
1452
- afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
1464
+ afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props );
1453
1465
}
1454
1466
return;
1455
1467
}
@@ -1463,7 +1475,7 @@ return /******/ (function(modules) { // webpackBootstrap
1463
1475
});
1464
1476
1465
1477
if (afterSaveCell) {
1466
- afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
1478
+ afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props );
1467
1479
}
1468
1480
}
1469
1481
}, {
@@ -7459,7 +7471,8 @@ return /******/ (function(modules) { // webpackBootstrap
7459
7471
var _props2 = this.props,
7460
7472
keyBoardNav = _props2.keyBoardNav,
7461
7473
onNavigateCell = _props2.onNavigateCell,
7462
- cellEdit = _props2.cellEdit;
7474
+ cellEdit = _props2.cellEdit,
7475
+ selectedRowKeys = _props2.selectedRowKeys;
7463
7476
7464
7477
var offset = void 0;
7465
7478
if (e.keyCode === 37) {
@@ -7476,16 +7489,23 @@ return /******/ (function(modules) { // webpackBootstrap
7476
7489
} else if (e.keyCode === 40) {
7477
7490
offset = { x: 0, y: 1 };
7478
7491
} else if (e.keyCode === 13) {
7492
+ var rowIndex = e.target.parentElement.rowIndex + 1;
7479
7493
var enterToEdit = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.enterToEdit : false;
7480
7494
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;
7481
7496
7482
7497
if (cellEdit && enterToEdit) {
7483
- this.handleEditCell(e.target.parentElement. rowIndex + 1 , e.currentTarget.cellIndex, '', e);
7498
+ this.handleEditCell(rowIndex, e.currentTarget.cellIndex, '', e);
7484
7499
}
7485
7500
7486
7501
if (enterToExpand) {
7487
7502
this.handleClickCell(this.props.y + 1, this.props.x);
7488
7503
}
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
+ }
7489
7509
}
7490
7510
if (offset && keyBoardNav) {
7491
7511
onNavigateCell(offset);
0 commit comments