Try using editoptions
jQuery('#grid').jqGrid({
autowidth: true,
autoheight: true,
url : '',
mtype : 'POST',
colNames : [ 'ID','State', 'Product'],
colModel : [ {name : 'id',index : 'id',hidden:true,align:'center'},
{name : 'name',index :'name',width:200,
sortable:true,
align:'center',
editable:true,
cellEdit:true,
edittype: 'select',
formatter: 'select',
editoptions:{value: getAllSelectOptions()}
},
{name : 'product',index : 'product'},
],
rowNum : 10,
sortname : 'name',
viewrecords : true,
gridview:true,
pager : '#pager',
sortorder : 'desc',
caption : 'Setup',
datatype : 'json'
});
function getAllSelectOptions(){
var states = { '1': 'Alabama', '2': 'California', '3': 'Florida',
'4': 'Hawaii', '5': 'London', '6': 'Oxford' };
return states;
}
See here and check here for all