Skip to content

Commit b4435df

Browse files
committed
fix: Update GridBody.getDataField to resolve pooled cell IDs correctly (#8998)
1 parent dac35ca commit b4435df

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

src/grid/Body.mjs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ class GridBody extends Container {
677677
* @returns {String}
678678
*/
679679
getCellDataField(cellId) {
680-
return cellId.split('__')[2]
680+
return this.getDataField(cellId)
681681
}
682682

683683
/**
@@ -752,6 +752,26 @@ class GridBody extends Container {
752752
* @returns {String}
753753
*/
754754
getDataField(cellId) {
755+
if (cellId.includes('__cell-')) {
756+
let me = this,
757+
poolIndex = parseInt(cellId.split('__cell-')[1]),
758+
columns = me.parent.columns,
759+
{cellPoolSize, mountedColumns} = me,
760+
i = mountedColumns[0],
761+
len = mountedColumns[1],
762+
column;
763+
764+
for (; i <= len; i++) {
765+
if (i % cellPoolSize === poolIndex) {
766+
column = columns.getAt(i);
767+
// Sanity check: ensure this column is actually pooled
768+
if (column && column.hideMode === 'removeDom') {
769+
return column.dataField
770+
}
771+
}
772+
}
773+
}
774+
755775
return cellId.split('__')[2]
756776
}
757777

0 commit comments

Comments
 (0)