这是我的代码:

$('#flex1').flexigrid({
            method: 'POST',
            url: '/services/MHService.asmx/GetSurgicalHistory',
            dataType: 'xml',
            colModel: [
                    { display: 'Surgical Procedure', name: 'SurgicalProcedure', width: 120, sortable: true, align: 'left' },
                    { display: 'Notes', name: 'Notes', width: 120, sortable: true, align: 'left' },
                    { display: 'Complications', name: 'Complications', width: 120, sortable: true, align: 'left' }
                ],
            searchitems: [
                    { display: 'Surgical Procedure', name: 'SurgicalProcedure' },
                    { display: 'Notes', name: 'Notes' },
                    { display: 'Complications', name: 'Complications' }
                ],
            sortname: 'SurgicalProcedure',
            singleSelect: true,
            sortorder: 'asc',
            usepager: true,
            title: 'Surigcal History',
            useRp: true,
            rp: 10,
            showTableToggleBtn: true,
            width: 805,
            height: 200
        });

现在这段代码有效了,我如何在网络服务中传递参数?我尝试在 Flexigrid api 中查找“数据”参数,但似乎没有。

像这样:
            method: 'POST',
            url: '/services/MHService.asmx/GetSurgicalHistory',
            dataType: 'xml',
            data: '{ id: 23, area: "anywhere" }',

最佳答案

我最终做的是这个
在 flexigrid.js 的第 713 行我添加了这个

            for(opt in p.optional){
              param[param.length] = {name:opt,value:p.optional[opt]};
            }

然后我可以做这样的事情
 $('#flex1').flexigrid({
        method: 'POST',
        url: '/services/MHService.asmx/GetSurgicalHistory',
        dataType: 'xml',
        colModel: [
                { display: 'Surgical Procedure', name: 'SurgicalProcedure', width: 120, sortable: true, align: 'left' },
                { display: 'Notes', name: 'Notes', width: 120, sortable: true, align: 'left' },
                { display: 'Complications', name: 'Complications', width: 120, sortable: true, align: 'left' }
            ],
        searchitems: [
                { display: 'Surgical Procedure', name: 'SurgicalProcedure' },
                { display: 'Notes', name: 'Notes' },
                { display: 'Complications', name: 'Complications' }
            ],
        sortname: 'SurgicalProcedure',
        singleSelect: true,
        sortorder: 'asc',
        usepager: true,
        title: 'Surigcal History',
        useRp: true,
        rp: 10,
        showTableToggleBtn: true,
        width: 805,
        height: 200,
        optional: { id: 23, area: "anywhere" }
    });

它不是很好,但我真的可以找到任何其他方式,而且我看不到任何新版本很快就会出现 8 ^ )

关于web-services - 你如何使用 Flexigrid 在 asmx 中传递参数?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3323865/

10-10 14:54