Skip to content

Commit 2a56e07

Browse files
committed
grid.View: getColumn() => adjust to the new parent columns collection #6531
1 parent 62a28d8 commit 2a56e07

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/grid/View.mjs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,11 @@ class GridView extends Component {
661661
* @returns {Object|Number|null}
662662
*/
663663
getColumn(field, returnIndex=false) {
664-
let columns = this.parent.headerToolbar.items,
665-
i = 0,
666-
len = columns.length,
667-
column;
664+
let {columns} = this.parent,
665+
column = columns.get(field);
668666

669-
for (; i < len; i++) {
670-
column = columns[i];
671-
672-
if (column.dataField === field) {
673-
return returnIndex ? i : column
674-
}
667+
if (column) {
668+
return returnIndex ? columns.indexOf(column) : column
675669
}
676670

677671
return null

0 commit comments

Comments
 (0)