PDA

View Full Version : getting the row data using rowIndex



Vijaya436
20 Aug 2009, 7:35 AM
Hi all..
I am completely new to ExtJs. I am having a grid in which the rows are to be selected. On Click of the row i want the complete information which that particular row consists from the browser to the js file. For this I want a small example to get the row information using the rowIndex(which I am able to get).
Any help can be most helpful.. Thanks in advance..

dlbjr
20 Aug 2009, 8:52 AM
var g = new Ext.grid.GridPanel({
sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
cm: new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), {
header: 'id',
dataIndex: 'ag_id',
hideable: true,
sortable: true,
hidden: true,
width: 120
}])
});

g.on('rowclick', function(grid, rowIndex, e) {
record = this.getStore().getAt(rowIndex);
//Do what ever with record
});

g.on('rowcontextmenu', function(grid, rowIndex, e) {
record = this.getStore().getAt(rowIndex);
//Do what ever with record
});

Vijaya436
21 Aug 2009, 8:08 AM
I am getting the values in the js file.. I missed the value of the Ext.grid which is already defined.. The code which served my request is

var rowContent = schoolInfoGrid.getStore().getAt(rowIndex);

Thankall..