Forum

July 12th, 2025
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_TopicIcon
Custom form for search criteria
04/09/2009
11:18
Avatar
samtronik
New Member
Members
Forum Posts: 1
Member Since:
04/09/2009
sp_UserOfflineSmall Offline

I have an application that searches mysql using php, and returns JSON data that is then used to populate a custom written grid/table.

I want to replace this with the jqGrid, but having done so - Im having a few problems when applying new criteria to the grid.

The first time I search, it works fine. The url parameter picks up all the details for the jqGrid command (see below). However, if I then change the form field data and reclick the button which performs the search, the data is not updated (I assume because the <div> is already a jqGrid?

function runSearch(str){
    $("#tbSearchResults").jqGrid({
        width: 820,
        height: 'auto',
        url: '/my/data/clip.json.php?' + str,   .............

Is there another command to use to either recreate the entire grid from scratch using the new parameters, or is there something which will just replace the data content using the new information?

Im sure its going to be something simple, but I have spent a day trying to use the built in custom search features (which work in almost the same way as I need our form to work) but they are just not going to cut it - at least not without some really heavy customisation.

I would really like to be able to just use the existing form with the existing code, with the existing JSON.... but need the grid to accept revised criteria.

Please help!

Many many thanks,

Sam

06/09/2009
04:52
Avatar
Lotte-Sara Laan
Guest
Guests

Instead of recreating your grid everytime, you can just create your grid without the extra search data on init of the page. Then when doing the search you can use these functions:

$('#tbSearchResults').setGridParam({ postData:{ str }});
$('#tbSearchResults').trigger('reloadGrid');

I hope this answers your question.

Regards

Lotte-Sara Laan

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
27 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