Description
There's an issue when you have a regularly updating datasource. Let's say i update my grid datasource with the latest values every 15 seconds and in my grid i have a templated column with an input field. (not edit mode)
lets say i have row ids: 1 , 2 , 3 , 4 , 5 And for my third row i start typing in the input field while someone deleted row 2. Now i have rowId's 1 , 3 , 4 , 5. Now rowId 3 is my second row in the grid. Whatever i have typed, it appears in the input field of the second row. Which is correct. However, focus is now set to the input of my third row, thus rowid 4. Which is wrong.
I've been able to figure out that in 'ui-grid/ui-grid-row' template a variable rowRenderIndex is used to identify my grid row, however, when the datasource is updated, this value doesn't change? I've tried replacing that variable with the id of my record row.entity.id, but upon datasource update i see an inconsistency between my json object and the id used in the html. In the html it keeps using the order 1,2,3,4,5, eventhough i no longer have a record with id 2.
Is there any way to keep focus on my record with id 3? Seems like there's a bug in here somewhere.
A plunker to demonstrate the issue: http://plnkr.co/edit/HIWWHwJa7YTQMrvp7b1c?p=preview Every 2 second i remove the first row. just start typing in the input field of record 8.