Jqgrid Pass select rows column values to dataurl

时光怂恿深爱的人放手 提交于 2019-12-25 03:44:18

问题


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'} 
}

回答1:


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.



来源:https://stackoverflow.com/questions/24975612/jqgrid-pass-select-rows-column-values-to-dataurl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!