I have been trying to get the value of clicked cell on grid.
cellDblClick: function(self, td, cellIndex, record, tr, rowIndex, e, eOpts)
I know I can get the record data, but I need the name of the column to get the value of the data.
record.data["name_of_column"]
What's the approach to get the value of clicked cell on grid? Is it possible to get the column name of clicked cell on grid?
Can anyone shed the light for me?
N.B. I'm using extjs 4.2.1
You can use viewConfig of grid with cellclick listener as follows.
viewConfig : {
listeners : {
cellclick : function(view, cell, cellIndex, record,row, rowIndex, e) {
var clickedDataIndex = view.panel.headerCt.getHeaderAtIndex(cellIndex).dataIndex;
var clickedColumnName = view.panel.headerCt.getHeaderAtIndex(cellIndex).text;
var clickedCellValue = record.get(clickedDataIndex);
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With