I know to use
var sph1 = jQuery(‘#list1’).jqGrid(‘getCell’, id,’Sph1′);
jQuery(“#span_extra”).html(sph1);
var sph2 = jQuery(‘#list1’).jqGrid(‘getCell’, id,’Sph2′);
jQuery(“#span_extra”).html(sph2);
But I need to know where press user click on cell.
SPH1 or SPH2.
Thank you
If you are using celledit mode (excel view), then you can use event like:
$opt[“onCellSelect”] = “function(row,col,html,e) { }”;
…
$g->set_options($opt);
Thank you Abu.
But I don’t know how to connect ‘col’ variable.
$opt[“onCellSelect”] = “function(row,col,html,e){alert(col);}”;
….
function do_onselect(id)
{
if(col == 1)
var sph = jQuery(‘#list1’).jqGrid(‘getCell’, id,’Sph1′); // where invdate is column name
if(col == 2)
var sph = jQuery(‘#list1’).jqGrid(‘getCell’, id,’Sph2′); // where invdate is column name
jQuery(‘#span_extra’).html(sph);
llenaceldalentes(sph);
}
Thank you again!
It should be like:
$opt[“onCellSelect”] = “function(row,col,html,e){do_onselect(row,col,html,e);}”;
….
function do_onselect(row,col,html,e)
{
…
}