I have tried different ways to load dropdown
from my DB to jqgrid
but I really do not get it, the idea is to show the dropwdown
and set the selected
that I bring it from my DB . Attachment captures:
In charge should load my
dropdown
, but does not do it if you bring the data from my DB to fill this dropdown
:
To fill in the grid, bring the following data
:
My code is as follows:
var combobox_personal = $.ajax({
url:'/listadoPersonal',
async:false,
success:function(data, result){
if(!result){alert('erro ar cargar');}
}
}).responseText;
var sac_id=1;
var csrftoken = getCookie('csrftoken');
$("#grid_plan_accion").jqGrid({
url:'/selectPlanAccion',
postData: {
csrfmiddlewaretoken : csrftoken,
id_sac: sac_id,
},
datatype: 'json',
colNames: ['DETALLE<', 'PLAZO', 'RESPONSABLE', '<span class="badge bg-green">ACCIONES</span>'],
colModel: [
{ label: 'detalle_plan_accion', name: 'detalle_plan_accion', width: 170, sorttype: "string", editable: true, edittype:"text"},
{ label: 'plazo_plan_accion ', name: 'plazo_plan_accion', width: 40, sorttype: "string", editable: true, edittype: 'text' },
{name:'responsable_plan_accion_id',index:'responsable_plan_accion_id', width:100, editable:true, edittype: "select", formatter:'select',editoptions: { value: combobox_personal} },
{ name: "Acciones", formatter: buttonEliminarFormatter, width: 90, align:'center', search: false,
sortable: false, hidedlg: true, resizable: false, editable: false, viewable: false
}
],
rowNum: 10,
width:800,
height: 200,
//data:'mydata',
caption:'PLAN DE ACCION',
shrinkToFit: true,
pager: '#pager_plan_accion',
cellEdit: false,
cellsubmit: 'clientArray',
editurl: "clientArray",
});
I do not know what the error is maybe a suggestion ...