Hi, my aim is to select a row in the grid (and focus on the row), based on the 'egId' value in a (plain HTML) textbox.

for instance if the 'egId' value = 10
then I would like the record in the grid to be selected where the column called 'id' contains a value of 10 (not the record id).

The first 'if' in the code below is for when the 'egId' field is null. But when it is not null, this is when I'd like the grid to select the record based on the 'egId' field.

I tried using findRowIndex(), but whatever I enter returns 'false',
and the focusRow() and selectRow() methods has '8' as the parameter as I was just testing to see how they work.

Code:
        var id = Ext.getDom('egId').value;
        var fieldValue = Ext.getDom('egFieldValue').value;
        
        store.on('load', function() {
            if (!id && fieldValue) {
                grid.getSelectionModel().selectFirstRow();
            }
            else if(id && fieldValue) {
                
                var rowIndex = sapLinkGrid.getView().findRowIndex(id);
                alert(rowIndex);
            
                grid.getSelectionModel().selectRow(8);
                grid.getView().focusRow(8);
            }
            else {}
            
        });
Any help is greatly appreciated, and this is my first post so apologies if I've missed anything out.