json – ExtJS grid – how to focus on added row? – Education Career Blog

I have a grid(gridpanel) and data in it which I read from json query. After I added new bussines object(row) – I send him in json format to server, write to DB, and reload all grid. How I can focus on currently added row(b/o) after that? I will be very cool if I return added id at the json answer and grid take it and focus on row with added id.
Thx.

,

How is your data being added (append-mode or not?). You can do grid_panel.getView().focusRow(row) on the length of the data array in the store, which will focus on the “last” row that was inserted. Also, you could hook into the rowsinserted event of GridView, and focusRow on the lastRow parameter that’s passed in there.

Leave a Comment