PDA

View Full Version : click to a editorGrid cell but row no selected



sofway
24 Mar 2010, 12:26 PM
i have a grid and a button to add rows dinamically. But when i add a row, this rows doesnt shows selected.
I use sm: new Ext.grid.RowSelectionModel({singleSelect: true}),

How can i set the row selected when i add a new row?

conorarmstrong
24 Mar 2010, 3:50 PM
have you read the api at all?

http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.RowSelectionModel

have a look at the selectRow method.

sofway
24 Mar 2010, 4:37 PM
yes, and i dont see any configuration parameter to indicate that the first row added must be selected

Zdeno
24 Mar 2010, 4:48 PM
After you will add new row to the store, set focus/select on last row like:


myGrid.getSelectionModel().selectRow(myGrid.getStore().getCount().length-1)
myGrid.getView().focusRow(myGrid.getStore().getCount().length - 1)

Thats what im trieing to do now :)