Forum



01:24

25/02/2010

Hello,
I'm not sure why I'm haveing a hard time trying to formulate my questions but here it goes.
I would like to have a form on one page that calls another page which has the jqGrid in it and I would like the form content to create the baseline query for the Grid.
For Example:
index.cfm
<form action="quickSearch.cfm" method="get" name="searchForm">
<select name="field">
<option value="hostname">Hostname</option>
<option value="ipaddress">IP Address</option>
</select>
<input type="text" value="" name="searchData" />
<input type="submit" value="Search">
</form>
</body>
quickSearch.cfm
$(document).ready(function()
{
$("#resultsGrid").jqGrid(
{
url:'quickSearch.cfc?method=getClientData', // <--- Here is where I want to add the query filter
datatype: 'json'
What do I need to do to make this happen?
Thanks!
17:42

10/08/2009

First of all, if you use HTTP GET to fill the grid the url: 'quickSearch.cfc?method=getClientData' is the same as url: 'quickSearch.cfc' and postData: {method: 'getClientData'} (see description of the data parameter of http://api.jquery.com/jQuery.a...../ for more information)
You can bind trigger('reloadGrid') to the click event of the submit button of the form (the type can be changed to the "button"). The using of postData work of cause not only for HTTP GET, but with HTTP POST also, but the data will be post in the HTTP body instead of appending of the URL.
In this example I suppose that the form is on the same page as jqGrid. If you want to place jqGrid on the other page you can modify the contain of functions from the postData correspond to the way which you use th the forward the information about the form state.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
65 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66