开发者

ExtJS grid - how to focus on added row?

开发者 https://www.devze.com 2023-01-20 19:08 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消