forked from opentiny/tiny-vue
fix(grid): [grid] fix nested grid context menu error (#1578)
This commit is contained in:
parent
f834ca7e05
commit
ce46b8a06f
|
@ -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) })
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue