I need to have the currently selected row id in order to build a JSON string that will be passed to a php script in order to create a select, so I enclosed the script reference and code in a function.
However, doing so creates a NetworkError: 403 Forbidden
error.
Here is the code segment:
editoptions:{dataUrl:function(){
var row_id = $('#tab3-grid').getGridParam('selrow');
var jsondata = JSON.stringify({"cu.STID": $('#tab3-grid').jqGrid('getCell', row_id, 'cu.STID'),
"wv.SVID": $('#tab3-grid').jqGrid('getCell', row_id, 'wv.SVID')});
return 'php/items-se-script.php?data='+jsondata;
},
Does anyone know whats going on?
UPDATE:
{name:'it.PRID', index:'it.PRID', hidden: true, editable:true, edittype:'select',
editoptions:{dataUrl:'php/items-se-script.php', defaultValue:'26', dataEvents:[{type:'change',fn:function(e){$('input#ip\.Item').val($('option:selected', this).text());}}]},
formoptions:{label:'Item', elmprefix:'* '},
editrules:{edithidden:true, required:true}},
{name:'ip.Item', index:'ip.Item', hidden: true, sortable: true, editable:false, edittype:'text', editoptions:{readonly:true,size:20}, formoptions:{rowpos: 50, label:'Item'}, editrules:{required:true}}
],
ajaxSelectOptions: {
type:'POST',
data: {
data: function () {
var row_id = $('#tab3-grid').getGridParam('selrow');
return JSON.stringify({
"cu.STID": $('#tab3-grid').jqGrid('getCell', row_id, 'cu.STID'),
"wv.SVID": $('#tab3-grid').jqGrid('getCell', row_id, 'wv.SVID')
});
}
}
},
url: 'php/workordertab-script.php',
editurl:'php/workordertab-script.php',
See Question&Answers more detail:
os