mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
samll refactor
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
name: 'Set NULL',
|
||||
keyText: 'Ctrl+0',
|
||||
testEnabled: () => getCurrentDataGrid()?.getGrider()?.editable,
|
||||
onClick: () => getCurrentDataGrid().setNull(),
|
||||
onClick: () => getCurrentDataGrid().setFixedValue(null),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
@@ -310,10 +310,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
export function setNull() {
|
||||
export function setFixedValue(value) {
|
||||
grider.beginUpdate();
|
||||
selectedCells.filter(isRegularCell).forEach(cell => {
|
||||
setCellValue(cell, null);
|
||||
setCellValue(cell, value);
|
||||
});
|
||||
grider.endUpdate();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
name: 'Set NULL',
|
||||
keyText: 'Ctrl+0',
|
||||
testEnabled: () => getCurrentDataForm() != null,
|
||||
onClick: () => getCurrentDataForm().setNull(),
|
||||
onClick: () => getCurrentDataForm().setFixedValue(null),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
@@ -247,9 +247,9 @@
|
||||
// if (onSave) onSave();
|
||||
// }
|
||||
|
||||
export function setNull() {
|
||||
export function setFixedValue(value) {
|
||||
if (isDataCell(currentCell)) {
|
||||
setCellValue(currentCell, null);
|
||||
setCellValue(currentCell, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user