Skip to content

Display field value from grid using custom event

Question:
I have this working now so that when the user clicks on the row 

the contents of the cell I want are returned - is it possible to do it when 
they just click on the cell instead rather than the whole row?

My code for row select:

An event as follows:

$dg -> add_event("jqGridSelectRow", $onSelectRow);
$onSelectRow = <<<ONSELECTROW
function(status, rowid) 

var cont = $('#upload_data').jqGrid('getCell',rowid,'FILE_NAME'); 
window.open("http://www.fixautocloud.com/user_data/".concat(cont))
}
ONSELECTROW;




Answer:
Use "jqGridCellSelect" event instead. Everything else stays the same.

Code sample (untested):

$dg -> add_event("jqGridCellSelect", $onSelectCell);

$onSelectCell = <<<ONSELECTCELL
function(rowid, colName, cellContent, rowIndex, colIndex)
{
var cont = $('#upload_data').jqGrid('getCell',rowid,'FILE_NAME'); 
window.open("http://www.fixautocloud.com/user_data/".concat(cont))
}
ONSELECTCELL

Feedback and Knowledge Base