Forum
Topic RSS
11:18
04/09/2009
OfflineI 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
04:52
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').trigger('reloadGrid');
I hope this answers your question.
Regards
Lotte-Sara Laan
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home