easyui:datagrid editor 如何把 id值赋给另外一个字段后面的URL作为参数

时间:2022-11-18 15:01:38

 $('#dg_BusinessRuleList').datagrid({
            url: 'craft/MCC.ashx?act=getRuleData',
            method: "get",
            fit: true,
            border: false,
            rownumbers: true,
            singleSelect: true,
            pagination: false,
            toolbar: "#tb_BusinessRule",
            queryParams: {
                'MCCPTEntryID': MCCPTEntryID
            },
            onClickRow: function (index) {
                onClickRow_RuleEntry(index);
            },
            columns: [[
            { field: 'id', hidden:true },
            { field: 'fCode', title: '规则编号', width: 100, align: 'center' },
            { field: 'fName', title: '规则名称', width: 150, align: 'center' },
            {
                field: 'fValue', title: '值', width: 80, align: 'center',
                formatter: function (value, row) {
                    return row.fDescription;
                },
                editor: {
                    type: 'combobox',
                    options: {
                        valueField: 'fValue',
                        textField: 'fDescription',
                        method: 'get',
                        //required: true,
                        editable: false,
                        url: 'craft/MCC.ashx?act=getRulesEntrySelect&RulesID='+ 我这边就是要取filed:id 的值,请问这个要怎么写啊
                    }
                }
            }

            ]]
        });

RulesID:这边要跟着 field:id 的值,请问要怎么写 。好难啊。

3 个解决方案

#1


不需要配置。。动态获取editor后调用combobox的reload方法加载数据

onClickRow: function (index) {
   onClickRow_RuleEntry(index);
   var ed = $('#dg_BusinessRuleList').datagrid('getEditor', {index:index,field:'fValue'});//获取combobox编辑器
    var row=$('#dg_BusinessRuleList').datagrid('getRows')[index];//获取编辑的行的id
    $(ed.target).combobox('reload',''craft/MCC.ashx?act=getRulesEntrySelect&RulesID='+row.id)//动态加载传递id值
},

#2


该回复于2014-11-01 15:21:05被管理员删除

#3


该回复于2016-03-24 15:38:07被管理员删除

#1


不需要配置。。动态获取editor后调用combobox的reload方法加载数据

onClickRow: function (index) {
   onClickRow_RuleEntry(index);
   var ed = $('#dg_BusinessRuleList').datagrid('getEditor', {index:index,field:'fValue'});//获取combobox编辑器
    var row=$('#dg_BusinessRuleList').datagrid('getRows')[index];//获取编辑的行的id
    $(ed.target).combobox('reload',''craft/MCC.ashx?act=getRulesEntrySelect&RulesID='+row.id)//动态加载传递id值
},

#2


该回复于2014-11-01 15:21:05被管理员删除

#3


该回复于2016-03-24 15:38:07被管理员删除