dissectcode
21 Sep 2012, 2:51 AM
Hi all - I'm just starting out with 4.1 (I worked with 3.0 a bit) and I was following this example :
http://docs.sencha.com/architect/2/#!/guide/first_desktop_app
It went great but how do I select a default row to display upon application launch? NO row is selected and I would like to choose the first one to be active by default.
I want to try this which I saw in another post :
grid.getSelectionModel().selectRow(0)
but I don't know where to put it.....Or is there a better way?
Thank you!
The code for the grid, from that Sensha tutorial looks like this:
Ext.applyIf(me, {
dockedItems: [
{
xtype: 'gridpanel',
flex: 1,
dock: 'top',
height: 174,
width: 629,
store: 'DocDataStore',
viewConfig: {
},
columns: [
{
xtype: 'gridcolumn',
autoRender: false,
autoShow: false,
dataIndex: 'manufacturer',
text: 'Manufacturer'
},
{
xtype: 'gridcolumn',
dataIndex: 'model',
text: 'Model'
},
{
xtype: 'gridcolumn',
dataIndex: 'price',
text: 'Price'
},
{
xtype: 'gridcolumn',
dataIndex: 'wiki',
text: 'Wiki'
},
{
xtype: 'gridcolumn',
width: 117,
dataIndex: 'img',
text: 'Img'
}
],
listeners: {
select: {
fn: me.onGridpanelSelect,
scope: me
}
}
}
],
http://docs.sencha.com/architect/2/#!/guide/first_desktop_app
It went great but how do I select a default row to display upon application launch? NO row is selected and I would like to choose the first one to be active by default.
I want to try this which I saw in another post :
grid.getSelectionModel().selectRow(0)
but I don't know where to put it.....Or is there a better way?
Thank you!
The code for the grid, from that Sensha tutorial looks like this:
Ext.applyIf(me, {
dockedItems: [
{
xtype: 'gridpanel',
flex: 1,
dock: 'top',
height: 174,
width: 629,
store: 'DocDataStore',
viewConfig: {
},
columns: [
{
xtype: 'gridcolumn',
autoRender: false,
autoShow: false,
dataIndex: 'manufacturer',
text: 'Manufacturer'
},
{
xtype: 'gridcolumn',
dataIndex: 'model',
text: 'Model'
},
{
xtype: 'gridcolumn',
dataIndex: 'price',
text: 'Price'
},
{
xtype: 'gridcolumn',
dataIndex: 'wiki',
text: 'Wiki'
},
{
xtype: 'gridcolumn',
width: 117,
dataIndex: 'img',
text: 'Img'
}
],
listeners: {
select: {
fn: me.onGridpanelSelect,
scope: me
}
}
}
],