I'm creating a jqgrid with one drop down column. I need the options of the drop down columns to change dynamically so I thought I can catch the beforeCellEdit event.
however it does not seem to be firing. any idea on what i am doing wrong? there is no error, and i did check that i have included the jqgrid edit js files.
var lastsel2;
jQuery(document).ready(function(){
jQuery("#projectList").jqGrid({
datatype: 'json',
url:'projectDrv.jsp',
mtype: 'GET',
height: 250,
colNames:['Node','Proposal #', 'Status', 'Vendor', 'Actions'],
colModel :[
{name:'node', index:'node', width:100, editable:false, sortable:false},
{name:'proposal', index:'proposal', width:100, editable:false, resizable:true },
{name:'status', index:'status', width:100, resizable:true, sortable:false, editable:false },
{name:'vendor', index:'vendor', width:100, resizable:true, editable:false, sortable: false },
{name:'actions', index:'actions', width:100, resizable:true, sortable:false, editable: true, edittype:"select" }
],
pager: '#pager',
rowNum: 10,
sortname: 'proposal',
sortorder: 'desc',
viewrecords: true,
onSelectRow: function(id){
if (id && id!==lastsel2){
jQuery('#projectList').jqGrid('restoreRow',lastsel2);
jQuery('#projectList').jqGrid('editRow',id,true);
lastsel2 = id;
}
},
beforeEditCell: function(rowid, cellname, value, irow, icol) {
alert("before edit here " + rowid);
// set editoptions here
}
});