PDA

View Full Version : scroll to new record of grid



duk
16 Dec 2010, 6:25 AM
hi, all!

After add new record to grid I want make this (record) selected.
I use for this purpose that method:


somegrid.getSelectionModel().selectRow(store.indexOfId(AddedId));

record selected, but she out of visible part of grid, need scroll.

What i can do for make record visible for users ?

tnx, sorry for my english

fay
16 Dec 2010, 8:10 AM
Try: http://www.sencha.com/learn/Ext_FAQ_Grid#Scroll_to_particular_row

duk
17 Dec 2010, 1:57 AM
tnx for all!

Try differents ways, so



sGrid.getView().focusRow(store.indexOfId(curId));
sGrid.getView().getRow(store.indexOfId(curId)).scrollIntoView();
sGrid.getView().ensureVisible(store.indexOfId(curId), 0, false);


, but anyway:
after successful scroll to need row, scroll go to first row ((

christian130
17 Dec 2010, 6:49 AM
have u declared grid visible in the all script?? if so u can get the grid selection using the next:
grid.getSelectionModel().selection.record.data.part
"part stands for the id u gave to the column, example part could be id1 or field1 or column1"
"data is generic name for the json data that is contained into the grid/store"