Earlier today I almost asked how to find a grid column based on dataIndex. I'd searched the docs, the forums, and Google, and couldn't find the answer.

Then I remembered Ext.Array.pluck (and indexOf) and devised my own little function, see below. Am just sharing it here if anybody else ever needs something such as this in the future, so they won't search in vain like I did. Or am I duplicating something that exists in the framework somewhere already?

function findGridColumnByDataIndex(grid, dataIndex) {
    var gridColumns = grid.columns,
        gridDataIndices = Ext.Array.pluck(grid.columns, 'dataIndex');

    return gridColumns[Ext.Array.indexOf(gridDataIndices, dataIndex)];