Login Register

Focussing on cell

Hi,

I'm using Dojo 0.9. After editing a cell, I have an event to check if data entered was valid. I have two questions. How do I detect what row the cell was in? Second, how do I set the focus back on the cell where the data was entered incorrectly? Below is the function:

function onSetEvent(store,item,attr,oldVal,newVal) {
        var rowIndex = /* What to put here? */
        if(!validateCell(rowIndex, attr, newVal)) {
                store.setValue(item, attr, oldVal, true);
                /* How to set focus back on cell you were editing? */
        }
}

Thanks for your help, - Dave