PDA

View Full Version : Selecting 1st row in grid after store loads..



abcdef
8 Jun 2010, 11:19 PM
Hello,

I have a grid panel attached to a store and I would like to select the first item immediately after the store loads. What is the best way to do it?

Here is the code as a simplified example:


xtype: 'grid',
id: <>,
store: <>,
columns: <>,
sm: new Ext.grid.RowSelectionModel({
listeners: {
rowselect: function(Grid, RowIndex, Record) {
<>
}
}
}),
listeners: {
render: function() {
// I would like to select the first row in this grid panel after the store loads.
}
}

Thanks in advance..

evant
8 Jun 2010, 11:20 PM
http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.GridPanel&member=viewready

abcdef
9 Jun 2010, 12:03 AM
Exactly what I was looking for! Thank you..

Also, how do I refer to the Grid itself from inside one of its event handlers?