Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Using a form to define base query for jqGrid
28/08/2010
01:24
Avatar
tjones1105
Member
Members
Forum Posts: 18
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

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

<body>
<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

<script type="text/javascript">
    $(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!

29/08/2010
17:42
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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 

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information