开发者

jqGrid doesn't add search params to url

开发者 https://www.devze.com 2023-02-07 07:08 出处:网络
I\'m trying to use the filterToolbar search option. Unfortunately the search string with parameters isn\'t added to the url.

I'm trying to use the filterToolbar search option. Unfortunately the search string with parameters isn't added to the url. In debug I see that this line is executed:

590 if(!bsr) { $($t).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]); }

sd is true in my case.

I see that the values that need to be sent to the server are stored in a variable called sdata, which is not sent. I also see that the postData filters has the right data in it, but it's not sent.

I also noticed that $t.p.searchurl is undefined.

This my jqGrid init (sorry for the mess):

grid_options = {
                altclass: "grid-altrow",
                altRows: true,
                autowidth: true,
                beforeSelectRow: edit,
                datastr: datastr,
                datatype: datatype,
                height: "100%",
                hidegrid: false,                
                multiselect: true,
                multiselectWidth: 45,
                onPaging: do_page,
                onSortCol: sort,
                pager: "#pager",
                rowNum: ROW_NUM,
                sortname: "zone",
                url: url.toString(),
                gridComplete: grid_complete,
                jsonReader: {
                    page: page,
                    records: records,
                    repeatitems: false,
                    root: root,
                    total: total
                },
                prmNames: {
                    addoper: null,
                    deloper: null,
                    editoper: null,
                    id: null,
                    nd: null,
                    npage: null,
                    oper: null,
                    order: null,
                    page: null,
                    rows: null,
                    search: null,
                    sort: null,
                    subgridid: null,
                    totalrows: null
    开发者_C百科            },
                colNames: [
                    "Entry Id",
                    "Zone",
                    "IP Address",
                    "Netmask",
                    "Description"
                ],
                colModel: [
                    {
                        hidden: true,
                        index: "id",
                        name: "id"
                    },
                    {
                        editable: true,
                        editoptions: {
                            value: zone_map
                        },
                        edittype: "select",
                        index: "zone",
                        name: "zone"
                    },
                    {
                        editable: true,
                        editrules: {
                            required: true
                        },
                        index: "ip",
                        name: "ip"
                    },
                    {
                        editable: true,
                        editoptions: {value: netmask_edit_options_value},
                        edittype: "select",
                        index: "netmask",
                        name: "netmask",                        
                        stype: "select"
                    },
                    {
                        editable: true,
                        edittype: "custom",
                        index: "comment",
                        name: "comment"
                    }
                ]
            };
            grid.jqGrid(grid_options);              
            grid.jqGrid("filterToolbar", {
                searchOnEnter : false,
                stringResult: true,
                beforeSearch: function(e) {
                    debugger;
                }
            });

Any help please?


Eventually we used the solution of manually serializing postData on serializeGridData postback (after removing stringResult: true from the options).

I'm not 100% satisfied because we still don't know why this isn't happening out of the box as it should, and have a suspicion that something's still not 100% right in the configuration.

So I'm not accepting this answer, maybe someone will do better :)

Edit: Accepting this since no other solution was found.

0

精彩评论

暂无评论...
验证码 换一张
取 消