How can I get the selected cell value in JQgrid?
I have looked through examples where you get the selected row id and then get the cell value based on passing the column name to ‘getcell’
from How to get a jqGrid selected row cells value
e.g.
var grid = jQuery('#list');
var sel_id = grid.jqGrid('getGridParam', 'selrow');
var myCellData = grid.jqGrid('getCell', sel_id, 'MyColName');
Is there any way to get the cell value based on the selected cell without having to specify the column name?
outisde of jqgrid make a variable like
then inside the jqgrid initialisation use the onCellSelect to populate that variable with the cells content. check here for the event http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events
Alternatively you could use that same event to store the cells informations like row_id and column index in a variable, then use the “getCell” method with the information from the row and cell variables