Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS GridPanel Row Click

Tags:

extjs

I have designed an ExtJS GridPanel and populated data from a database. My requirement is when clicking on a grid row (like edit button) get an id from the grid and populate a window with specific data (retrive data using id from database). How can i achieve this?

like image 848
MNR Avatar asked Apr 26 '11 10:04

MNR


2 Answers

Use this:

            grid.on('rowclick', function(grid, rowIndex, columnIndex, e) {
                console.log(grid, rowIndex, columnIndex, e);
            }, this);

Edit: Refer ExtJS Grid FAQ section for Grid related issues

like image 181
Swar Avatar answered Nov 20 '22 08:11

Swar


Add it in grid's Listener:

listeners: {
    cellclick: function (grd, rowIndex, colIndex, e) {
       var record = grd.getStore().getAt(rowIndex);
       var record = grd.getStore().getAt(rowIndex);
    }
}
like image 26
Kunal Goel Avatar answered Nov 20 '22 08:11

Kunal Goel