fix(grid): [grid] fix nested grid context menu error (#1578)

This commit is contained in:
gimmyhehe 2024-04-19 09:24:04 +08:00 committed by GitHub
parent f834ca7e05
commit ce46b8a06f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -124,7 +124,10 @@ export default {
if (eventTargetNode.flag) {
let cell = eventTargetNode.targetElem
let column = this.getColumnNode(cell).item
let column = this.getColumnNode(cell)?.item
if (!column) {
return
}
let typePrefix = `${layout}-`
Object.assign(eventParams, { cell, column, columnIndex: this.getColumnIndex(column) })

View File

@ -420,15 +420,15 @@ const Methods = {
if (!cell) {
return null
}
let { isGroup, fullColumnIdData, tableFullColumn } = this
let dataColid = cell.getAttribute('data-colid')
const { isGroup, fullColumnIdData, tableFullColumn } = this
const dataColid = cell.getAttribute('data-colid')
const colCache = fullColumnIdData?.[dataColid]
if (isGroup) {
let matches = findTree(tableFullColumn, (column) => column.id === dataColid, headerProps)
if (matches) {
return matches
}
} else {
let colCache = fullColumnIdData[dataColid]
} else if (colCache) {
return {
index: colCache.index,
item: colCache.column,