feat(grid): link cell detail to selection
This commit is contained in:
1 parent
af5eb9cb2f
commit
612c6d36db
3 files changed
+55
No files matched your search
@@ -106,6 +106,7 @@ import {
|
||||
cellDetailEditorText,
|
||||
defaultCellDetailTab,
|
||||
formatJsonText,
|
||||
linkedCellDetailTarget,
|
||||
valueEditorActions,
|
||||
visibleCellDetailTabs,
|
||||
type CellDetailTab,
|
||||
@@ -2192,6 +2193,18 @@ function showCellDetails(rowIndex: number, colIndex: number) {
|
||||
showCellDetail.value = true;
|
||||
}
|
||||
|
||||
watch([selectedRange, showCellDetail, isEditingDetail], () => {
|
||||
const selectedCell = currentSelectedCellPosition();
|
||||
const target = linkedCellDetailTarget({
|
||||
isOpen: showCellDetail.value,
|
||||
isEditing: isEditingDetail.value,
|
||||
selectedCell: selectedCell ? { rowIndex: selectedCell.rowIndex, visibleColIndex: selectedCell.colIndex } : null,
|
||||
actualColumnIndex,
|
||||
});
|
||||
if (!target) return;
|
||||
detailCell.value = target;
|
||||
});
|
||||
|
||||
function openImagePreview(src: string, title: string) {
|
||||
imagePreviewSrc.value = src;
|
||||
imagePreviewTitle.value = title;
|
||||
|
||||
Reference in new issue
Block a user