ExtJS grid - how to focus on the added row?

I have a gridpanel and data in it that I read from a json request. After I added a new bussines (row) object, I send it in json format to the server, write to DB and reload the entire grid. How can I focus on the previously added line (b / o) after that? I will be very cool if I return the added identifier to the json response, and the grid takes it and focuses on the line with the added id. thank.

+3
source share
1 answer

How are your data added (append-mode or not?). You can do grid_panel.getView().focusRow(row)the length of the data array in the repository, which will focus on the "last" row that was inserted. In addition, you can connect to the event rowsinserted GridViewand the focusRowparameter lastRowthat was there.

+5
source

Source: https://habr.com/ru/post/1770502/


All Articles