rename some events.

This commit is contained in:
2024-01-23 09:22:08 +08:00
parent 10e4e52b51
commit 27b2f1052f
4 changed files with 46 additions and 37 deletions

View File

@ -100,11 +100,13 @@ export class Grid {
sortDirection = 1;
willSelect;
selectedRowChanged;
cellDblClicked;
cellClicked;
rowDblClicked;
columnChanged;
onSelectedRowChanged;
onCellDblClicked;
onRowDblClicked;
onColumnChanged;
onBodyScrolled;
static ColumnTypes = {
Common: 0,
@ -212,8 +214,8 @@ export class Grid {
}
});
}
if (typeof this.selectedRowChanged === 'function') {
this.selectedRowChanged();
if (typeof this.onSelectedRowChanged === 'function') {
this.onSelectedRowChanged();
}
}
@ -273,8 +275,8 @@ export class Grid {
this._var.selectedIndexes = [index];
this.scrollToIndex(index);
this.refresh();
if (typeof this.selectedRowChanged === 'function') {
this.selectedRowChanged(index);
if (typeof this.onSelectedRowChanged === 'function') {
this.onSelectedRowChanged(index);
}
e.stopPropagation();
}
@ -948,8 +950,8 @@ export class Grid {
}
});
if (typeof this.columnChanged === 'function') {
this.columnChanged(ColumnChangedType.Reorder, index, targetIndex);
if (typeof this.onColumnChanged === 'function') {
this.onColumnChanged(ColumnChangedType.Reorder, index, targetIndex);
}
}
}
@ -1038,8 +1040,8 @@ export class Grid {
this.sortIndex = index;
}
this.sortColumn();
if (typeof this.columnChanged === 'function') {
this.columnChanged(ColumnChangedType.Sort, index, this.sortDirection);
if (typeof this.onColumnChanged === 'function') {
this.onColumnChanged(ColumnChangedType.Sort, index, this.sortDirection);
}
}
}
@ -1363,8 +1365,8 @@ export class Grid {
delete attr.sizing;
delete attr.autoResize;
this._changeColumnWidth(index, width);
if (typeof this.columnChanged === 'function') {
this.columnChanged(ColumnChangedType.Resize, index, width);
if (typeof this.onColumnChanged === 'function') {
this.onColumnChanged(ColumnChangedType.Resize, index, width);
}
}
}
@ -1391,8 +1393,8 @@ export class Grid {
if (width > 0 && width !== col.width) {
width += 12;
this._changeColumnWidth(index, width);
if (typeof this.columnChanged === 'function') {
this.columnChanged(ColumnChangedType.Resize, index, width);
if (typeof this.onColumnChanged === 'function') {
this.onColumnChanged(ColumnChangedType.Resize, index, width);
}
}
}
@ -1429,8 +1431,8 @@ export class Grid {
if (this._var.colAttrs.__filtering != null) {
this._onCloseFilter();
}
if (this.bodyScrolled === 'function') {
this.bodyScrolled(e);
if (this.onBodyScrolled === 'function') {
this.onBodyScrolled(e);
}
if (!this.virtual) {
return;
@ -1544,8 +1546,8 @@ export class Grid {
}
});
}
if (typeof this.selectedRowChanged === 'function') {
this.selectedRowChanged(selectedIndex);
if (typeof this.onSelectedRowChanged === 'function') {
this.onSelectedRowChanged(selectedIndex);
}
}
this._var.selectedColumnIndex = colIndex;
@ -1562,13 +1564,13 @@ export class Grid {
return;
}
const index = this.selectedIndex;
if (typeof this.rowDblClicked === 'function') {
this.rowDblClicked(index);
if (typeof this.onRowDblClicked === 'function') {
this.onRowDblClicked(index);
}
if (typeof this.cellDblClicked === 'function') {
if (typeof this.onCellDblClicked === 'function') {
const colIndex = this._var.selectedColumnIndex;
if (this.fullrowClick || colIndex >= 0) {
this.cellDblClicked(index, colIndex);
this.onCellDblClicked(index, colIndex);
}
}
}