1、双击
var dblGrid = new Ext.grid.GridPanel({
}
dblGrid.addListener('rowdblclick', rowdblclickFn);
function rowdblclickFn(grid, rowindex, e){
grid.getSelectionModel().each(function(rec){
alert(rec.get(fieldName)); //fieldName,记录中的字段名
});
}
2、单击
var cb = new Ext.grid.RowSelectionModel({
singleSelect:true //如果值是false,表明可以选择多行;否则只能选择一行
});
var rowGrid = new Ext.grid.GridPanel({
}
rowGrid.addListener('rowclick', rowclickFn);
function rowclickFn(grid, rowindex, e){
grid.getSelectionModel().each(function(rec){
alert(rec.get(fieldName)); //fieldName,记录中的字段名
});
}