0

I'm trying to pass column values to php load the select item on the edit form based on the column values.

dataUrl:'includes/Opera_classif.php?Op=local&id=' +ID +Description +id_local

JS

mtype: 'GET', 
colNames: [ "ID","Descrição","ID Local", "Local","Select Local"],
colModel: [
{name:'ID',index:'ID', width:20, sorttype:"int"},
{name:'Description',index:'Description', width:150, editable: true,editrules:{required:true}},
{name:'id_local',index:'id_local',hidden:true, width:20, editable: true,editrules:{required:true}},
{name:'Local_Description',index:'Local_Description', width:100, editable: true,editrules:{required:true}},
{
    name:'escolhe_local',index:'escolhe_local', width:80,resizable:true, hidden:true, editrules:{edithidden: true }, 
    align:"left",sorttype:"text",editable:true,edittype:"select",
    editoptions:{dataUrl:'includes/Opera_classif.php?Op=local'} 
}
Valentin Mercier
  • 5,256
  • 3
  • 26
  • 50
Jorge
  • 3
  • 2

1 Answers1

0

One can use dataUrl defined as function (see here and here). The function dataUrl get 3 parameter (the first is the rowid, the second is the value from the current column - Local_Description in your case) and this will be initialized to DOM of the grid (so you can use $(this).jqGrid("getRowData", rowid) or $(this).jqGrid("getCell", rowid, "Description") for example). In the way you can generate any dataUrl value which you need.

Oleg
  • 220,925
  • 34
  • 403
  • 798