【问题标题】:Jqgrid Pass select rows column values to dataurlJqgrid 将选择行列值传递给 dataurl
【发布时间】:2014-07-26 21:16:57
【问题描述】:

我正在尝试将列值传递给 php,根据列值在编辑表单上加载选择项。

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

【问题讨论】:

    标签: php jquery jqgrid


    【解决方案1】:

    可以使用定义为函数的dataUrl(参见herehere)。函数 dataUrl 获取 3 个参数(第一个是 rowid,第二个是当前列的值 - 在你的情况下是 Local_Description)和 this 将被初始化为网格的 DOM(这样你就可以例如使用$(this).jqGrid("getRowData", rowid)$(this).jqGrid("getCell", rowid, "Description"))。通过这种方式,您可以生成任何您需要的dataUrl 值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-04
      • 1970-01-01
      • 2018-10-01
      • 2013-02-24
      • 1970-01-01
      相关资源
      最近更新 更多