dotnetCarpenter
17 Apr 2007, 7:35 AM
Just a quick question:
I have two code snippets that to me is almost identical but one work and the second won't. I just don't see why not(!?). First the code snippet that won't work:
var rsm = new Ext.grid.RowSelectionModel({singleSelect:true});
rsm.on('rowselect', function(e, rownumber, row){
Ext.MessageBox.alert('row.data.eventID', row.data.eventID);
});
// create the grid
var grid = new Ext.grid.Grid('events-grid', {
ds: ds,
cm: cm,
selModel: rsm,
enableColLock:false,
loadMask: {msg: 'Henter events...', msgCls: 'gridMsg'}
}
and then the approach that works:
// create the grid
var grid = new Ext.grid.Grid('events-grid', {
ds: ds,
cm: cm,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
enableColLock:false,
loadMask: {msg: 'Henter events...', msgCls: 'gridMsg'}
});
grid.getSelectionModel().on('rowselect', function(e, rownumber, row) {
Ext.MessageBox.alert('row.data.eventID', row.data.eventID);
});What gives?
I have two code snippets that to me is almost identical but one work and the second won't. I just don't see why not(!?). First the code snippet that won't work:
var rsm = new Ext.grid.RowSelectionModel({singleSelect:true});
rsm.on('rowselect', function(e, rownumber, row){
Ext.MessageBox.alert('row.data.eventID', row.data.eventID);
});
// create the grid
var grid = new Ext.grid.Grid('events-grid', {
ds: ds,
cm: cm,
selModel: rsm,
enableColLock:false,
loadMask: {msg: 'Henter events...', msgCls: 'gridMsg'}
}
and then the approach that works:
// create the grid
var grid = new Ext.grid.Grid('events-grid', {
ds: ds,
cm: cm,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
enableColLock:false,
loadMask: {msg: 'Henter events...', msgCls: 'gridMsg'}
});
grid.getSelectionModel().on('rowselect', function(e, rownumber, row) {
Ext.MessageBox.alert('row.data.eventID', row.data.eventID);
});What gives?