Hi,
Please try replacing onCellSelect with onSelectCell. There seems to be a confusion in api, where first is called only on mouse selection and later works on keyboard/mouse selection both.
$grid[“onSelectCell”] = “function(rowid, celname, value, iRow, iCol){ alert(‘onSelectCell’); }”;
$g->set_options($grid);
var opts =
{
‘onSelectCell’: function (rowid,icol,cellcontent)
{
alert(“celected”);
if(icol == 1)
{
parent.$(‘#codigo’).val(cellcontent);
var e = jQuery.Event(“keydown”);
e.which = 13;
parent.$(‘#codigo’).trigger(e);
self.close();
parent.$.colorbox.close();
}
else
{
parent.$(‘#codigo’).val(jQuery(‘#list1’).jqGrid(‘getCell’, rowid, ‘ProCodigo’));
var e = jQuery.Event(“keydown”);
e.which = 13;
parent.$(‘#codigo’).trigger(e);
self.close();
parent.$.colorbox.close();
}
}
}
The var opts = { … }; method is not recommended as it removed all previous grid options. Best way to do is using set_options() method as in reply #2.