@@ -6049,12 +6049,14 @@ function time(cell, onRendered, success, cancel, editorParams){
6049
6049
newDatetime = DT.fromFormat(String(cellValue), inputFormat);
6050
6050
}
6051
6051
6052
- cellValue = newDatetime.toFormat("hh :mm");
6052
+ cellValue = newDatetime.toFormat("HH :mm");
6053
6053
6054
6054
}else {
6055
6055
console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
6056
6056
}
6057
6057
}
6058
+
6059
+ console.log("val", cellValue);
6058
6060
6059
6061
input.value = cellValue;
6060
6062
@@ -6176,7 +6178,7 @@ function datetime(cell, onRendered, success, cancel, editorParams){
6176
6178
newDatetime = DT.fromFormat(String(cellValue), inputFormat);
6177
6179
}
6178
6180
6179
- cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("hh :mm");
6181
+ cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("HH :mm");
6180
6182
}else {
6181
6183
console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
6182
6184
}
@@ -11068,6 +11070,7 @@ class FrozenColumns extends Module{
11068
11070
this.subscribe("column-deleted", this.reinitializeColumns.bind(this));
11069
11071
this.subscribe("column-hide", this.reinitializeColumns.bind(this));
11070
11072
this.subscribe("column-show", this.reinitializeColumns.bind(this));
11073
+ this.subscribe("columns-loaded", this.reinitializeColumns.bind(this));
11071
11074
11072
11075
this.subscribe("table-redraw", this.layout.bind(this));
11073
11076
this.subscribe("layout-refreshing", this.blockLayout.bind(this));
@@ -20067,6 +20070,13 @@ class Range extends CoreFeature{
20067
20070
this.table = table;
20068
20071
this.start = {row:0, col:0};
20069
20072
this.end = {row:0, col:0};
20073
+
20074
+ if(this.rangeManager.rowHeader){
20075
+ this.left = 1;
20076
+ this.right = 1;
20077
+ this.start.col = 1;
20078
+ this.end.col = 1;
20079
+ }
20070
20080
20071
20081
this.initElement();
20072
20082
@@ -20126,14 +20136,14 @@ class Range extends CoreFeature{
20126
20136
20127
20137
if (element.type === "column") {
20128
20138
if(this.rangeManager.columnSelection){
20129
- this.setStart(0, element.getPosition() - 2 );
20139
+ this.setStart(0, element.getPosition() - 1 );
20130
20140
}
20131
20141
}else {
20132
20142
row = element.row.position - 1;
20133
- col = element.column.getPosition() - 2 ;
20143
+ col = element.column.getPosition() - 1 ;
20134
20144
20135
20145
if (element.column === this.rangeManager.rowHeader) {
20136
- this.setStart(row, 0 );
20146
+ this.setStart(row, 1 );
20137
20147
} else {
20138
20148
this.setStart(row, col);
20139
20149
}
@@ -20147,18 +20157,18 @@ class Range extends CoreFeature{
20147
20157
if (element.type === "column") {
20148
20158
if(this.rangeManager.columnSelection){
20149
20159
if (this.rangeManager.selecting === "column") {
20150
- this.setEnd(rowsCount - 1, element.getPosition() - 2 );
20160
+ this.setEnd(rowsCount - 1, element.getPosition() - 1 );
20151
20161
} else if (this.rangeManager.selecting === "cell") {
20152
- this.setEnd(0, element.getPosition() - 2 );
20162
+ this.setEnd(0, element.getPosition() - 1 );
20153
20163
}
20154
20164
}
20155
20165
}else {
20156
20166
row = element.row.position - 1;
20157
- col = element.column.getPosition() - 2 ;
20167
+ col = element.column.getPosition() - 1 ;
20158
20168
isRowHeader = element.column === this.rangeManager.rowHeader;
20159
20169
20160
20170
if (this.rangeManager.selecting === "row") {
20161
- this.setEnd(row, this._getTableColumns().length - 2 );
20171
+ this.setEnd(row, this._getTableColumns().length - 1 );
20162
20172
} else if (this.rangeManager.selecting !== "row" && isRowHeader) {
20163
20173
this.setEnd(row, 0);
20164
20174
} else if (this.rangeManager.selecting === "column") {
@@ -20240,11 +20250,11 @@ class Range extends CoreFeature{
20240
20250
}
20241
20251
20242
20252
atTopLeft(cell) {
20243
- return cell.row.position - 1 === this.top && cell.column.getPosition() - 2 === this.left;
20253
+ return cell.row.position - 1 === this.top && cell.column.getPosition() - 1 === this.left;
20244
20254
}
20245
20255
20246
20256
atBottomRight(cell) {
20247
- return cell.row.position - 1 === this.bottom && cell.column.getPosition() - 2 === this.right;
20257
+ return cell.row.position - 1 === this.bottom && cell.column.getPosition() - 1 === this.right;
20248
20258
}
20249
20259
20250
20260
occupies(cell) {
@@ -20256,7 +20266,7 @@ class Range extends CoreFeature{
20256
20266
}
20257
20267
20258
20268
occupiesColumn(col) {
20259
- return this.left <= col.getPosition() - 2 && col.getPosition() - 2 <= this.right;
20269
+ return this.left <= col.getPosition() - 1 && col.getPosition() - 1 <= this.right;
20260
20270
}
20261
20271
20262
20272
overlaps(left, top, right, bottom) {
@@ -20325,7 +20335,7 @@ class Range extends CoreFeature{
20325
20335
}
20326
20336
20327
20337
getColumns() {
20328
- return this._getTableColumns().slice(this.left + 1 , this.right + 2 );
20338
+ return this._getTableColumns().slice(this.left, this.right + 1 );
20329
20339
}
20330
20340
20331
20341
clearValues(){
@@ -20511,7 +20521,7 @@ class SelectRange extends Module {
20511
20521
20512
20522
initializeColumn(column) {
20513
20523
if(this.columnSelection && column.definition.headerSort && this.options("headerSortClickElement") !== "icon"){
20514
- console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior");
20524
+ console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'. ");
20515
20525
}
20516
20526
20517
20527
if (column.modules.edit) ;
@@ -20806,7 +20816,7 @@ class SelectRange extends Module {
20806
20816
nextCol = Math.max(nextCol - 1, 0);
20807
20817
break;
20808
20818
case "right":
20809
- nextCol = Math.min(nextCol + 1, this.getTableColumns().length - 2 );
20819
+ nextCol = Math.min(nextCol + 1, this.getTableColumns().length - 1 );
20810
20820
break;
20811
20821
case "up":
20812
20822
nextRow = Math.max(nextRow - 1, 0);
@@ -20900,13 +20910,14 @@ class SelectRange extends Module {
20900
20910
findJumpCellLeft(rowPos, colPos){
20901
20911
var row = this.getRowByRangePos(rowPos),
20902
20912
cells = row.cells.filter((cell) => cell.column.visible),
20903
- isStartingCellEmpty = !cells[colPos + 1 ].getValue(),
20913
+ isStartingCellEmpty = !cells[colPos].getValue(),
20904
20914
isLeftOfStartingCellEmpty = cells[colPos] ? !cells[colPos].getValue() : false,
20905
20915
jumpCol = colPos,
20906
- nextCell = this.findJumpCell(cells.slice(0, colPos), true, isStartingCellEmpty, isLeftOfStartingCellEmpty);
20916
+ targetCells = this.rowHeader ? cells.slice(1, colPos) : cells.slice(0, colPos),
20917
+ nextCell = this.findJumpCell(targetCells, true, isStartingCellEmpty, isLeftOfStartingCellEmpty);
20907
20918
20908
20919
if(nextCell){
20909
- jumpCol = nextCell.column.getPosition() - 2 ;
20920
+ jumpCol = nextCell.column.getPosition() - 1 ;
20910
20921
}
20911
20922
20912
20923
return jumpCol;
@@ -20915,13 +20926,13 @@ class SelectRange extends Module {
20915
20926
findJumpCellRight(rowPos, colPos){
20916
20927
var row = this.getRowByRangePos(rowPos),
20917
20928
cells = row.cells.filter((cell) => cell.column.visible),
20918
- isStartingCellEmpty = !cells[colPos + 1 ].getValue(),
20919
- isRightOfStartingCellEmpty = cells[colPos + 2 ] ? !cells[colPos + 2 ].getValue() : false,
20929
+ isStartingCellEmpty = !cells[colPos].getValue(),
20930
+ isRightOfStartingCellEmpty = cells[colPos + 1 ] ? !cells[colPos + 1 ].getValue() : false,
20920
20931
jumpCol = colPos,
20921
- nextCell = this.findJumpCell(cells.slice(colPos + 2 , cells.length), false, isStartingCellEmpty, isRightOfStartingCellEmpty);
20932
+ nextCell = this.findJumpCell(cells.slice(colPos + 1 , cells.length), false, isStartingCellEmpty, isRightOfStartingCellEmpty);
20922
20933
20923
20934
if(nextCell){
20924
- jumpCol = nextCell.column.getPosition() - 2 ;
20935
+ jumpCol = nextCell.column.getPosition() - 1 ;
20925
20936
}
20926
20937
20927
20938
return jumpCol;
@@ -20972,8 +20983,13 @@ class SelectRange extends Module {
20972
20983
range = this.resetRanges();
20973
20984
this.selecting = "all";
20974
20985
20975
- const topLeftCell = this.getCell(0, 0);
20976
- const bottomRightCell = this.getCell(-1, -1);
20986
+ var topLeftCell, bottomRightCell = this.getCell(-1, -1);
20987
+
20988
+ if(this.rowHeader){
20989
+ topLeftCell = this.getCell(0, 1);
20990
+ }else {
20991
+ topLeftCell = this.getCell(0, 0);
20992
+ }
20977
20993
20978
20994
range.setBounds(topLeftCell, bottomRightCell);
20979
20995
return;
@@ -20997,16 +21013,19 @@ class SelectRange extends Module {
20997
21013
20998
21014
autoScroll(range, row, column) {
20999
21015
var tableHolder = this.table.rowManager.element,
21000
- rowHeader = this.rowHeader.getElement(),
21001
- rect, view, withinHorizontalView, withinVerticalView;
21002
-
21016
+ rowHeader, rect, view, withinHorizontalView, withinVerticalView;
21017
+
21003
21018
if (typeof row === 'undefined') {
21004
21019
row = this.getRowByRangePos(range.end.row).getElement();
21005
21020
}
21006
21021
21007
21022
if (typeof column === 'undefined') {
21008
21023
column = this.getColumnByRangePos(range.end.col).getElement();
21009
21024
}
21025
+
21026
+ if (this.rowHeader) {
21027
+ rowHeader = this.rowHeader.getElement();
21028
+ }
21010
21029
21011
21030
rect = {
21012
21031
left: column.offsetLeft,
@@ -21016,19 +21035,26 @@ class SelectRange extends Module {
21016
21035
};
21017
21036
21018
21037
view = {
21019
- left: tableHolder.scrollLeft + rowHeader.offsetWidth ,
21038
+ left: tableHolder.scrollLeft,
21020
21039
right: Math.ceil(tableHolder.scrollLeft + tableHolder.clientWidth),
21021
21040
top: tableHolder.scrollTop,
21022
21041
bottom: tableHolder.scrollTop + tableHolder.offsetHeight - this.table.rowManager.scrollbarWidth,
21023
21042
};
21043
+
21044
+ if (rowHeader) {
21045
+ view.left += rowHeader.offsetWidth;
21046
+ }
21024
21047
21025
21048
withinHorizontalView = view.left < rect.left && rect.left < view.right && view.left < rect.right && rect.right < view.right;
21026
21049
21027
21050
withinVerticalView = view.top < rect.top && rect.top < view.bottom && view.top < rect.bottom && rect.bottom < view.bottom;
21028
21051
21029
21052
if (!withinHorizontalView) {
21030
21053
if (rect.left < view.left) {
21031
- tableHolder.scrollLeft = rect.left - rowHeader.offsetWidth;
21054
+ tableHolder.scrollLeft = rect.left;
21055
+ if (rowHeader) {
21056
+ tableHolder.scrollLeft -= rowHeader.offsetWidth;
21057
+ }
21032
21058
} else if (rect.right > view.right) {
21033
21059
tableHolder.scrollLeft = rect.right - tableHolder.clientWidth;
21034
21060
}
@@ -21147,8 +21173,7 @@ class SelectRange extends Module {
21147
21173
var row;
21148
21174
21149
21175
if (colIdx < 0) {
21150
- colIdx = this.getTableColumns().length + colIdx - 1;
21151
-
21176
+ colIdx = this.getTableColumns().length + colIdx;
21152
21177
if (colIdx < 0) {
21153
21178
return null;
21154
21179
}
@@ -21160,7 +21185,7 @@ class SelectRange extends Module {
21160
21185
21161
21186
row = this.table.rowManager.getRowFromPosition(rowIdx + 1);
21162
21187
21163
- return row ? row.getCells(false, true).filter((cell) => cell.column.visible)[colIdx + 1 ] : null;
21188
+ return row ? row.getCells(false, true).filter((cell) => cell.column.visible)[colIdx] : null;
21164
21189
}
21165
21190
21166
21191
@@ -21173,7 +21198,7 @@ class SelectRange extends Module {
21173
21198
}
21174
21199
21175
21200
getColumnByRangePos(pos) {
21176
- return this.getTableColumns()[pos + 1 ];
21201
+ return this.getTableColumns()[pos];
21177
21202
}
21178
21203
21179
21204
getTableRows() {
0 commit comments