views:

77

answers:

1

here's my code:

$('#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
        });

Now this code works, how do i pass parameters in the webservice? i tried looking for the 'data' parameter in the Flexigrid api, but there seems to be none.

something like this:

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

what I ended up doing was this on line 713 of flexigrid.js i add this

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

then I could do something like this

 $('#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" }
    });

its not great but I really could find any other way and I don't see any new versions coming out anytime soon 8 ^ )

mcgrailm