Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add additional parameter to JQGrid

Tags:

jqgrid

I'm not sure how to best phrase this, especially while trying to research it. I am trying to add an additional parameter to the search string when my page loads a jqgrid:

http://localhost/jqgrid.cgi?_search=false&nd=1308125954351&rows=25&page=1&sidx=Change&sord=asc

I simply want to append an additional "value=something" to the URL string to use as an argument for my SQL call. This parameter is not a value contained within the grid, it is merely a value that I wish to use in a WHERE clause from a page that is used to build the grid.

Desired result:

http://localhost/jqgrid.cgi?_search=false&nd=1308125954351&rows=25&page=1&sidx=Change&sord=asc&value=something

like image 540
Mose Avatar asked Dec 06 '22 21:12

Mose


1 Answers

If you use mtype:"GET" you can use postData to add new parameter:

postData: {
    value: "something"
}

or even

postData: {
    value: function() {
        return $("#anyPageElement").val(); // or other method which read the value
    }
}

see here for details.

like image 91
Oleg Avatar answered Jan 17 '23 12:01

Oleg