how to get current row index in javascript