Forum
20:54
07/01/2010
I have implemented the jQuery Grid into my ASP.NET MVC application, and have seen numerous examples on how to load the grid in the documet.ready function, however I need to do it otherwise.
I need to show the grid after the user has entered some information in a couple (2) textboxes and then clicked a button (search). The jQuery Grid will display the results of the search. This is impossible to do though without being able to pass these 2 parameters into the grid so that when it goes to the url 'MSF/DynamicGridData/' along with the sortname, sort order, page, etc., parameters it also passes in the values from my 2 textboxes.
I haven't got a clue how to do this, but it seems that I Grid for displaying data wouldn'e be much good if it didn't take parameters somehow.
Please help!
Thanks,
Brian
13:54
10/08/2009
Hi!
You can use postData to give parameters which will be appended to the url before the request. To make no request at the page start you can set datatype parameter to 'local' at the beginning. After user click in the "search" button you can change datatype parameter to 'json' and page to 1 with respect of setGridParam() and then call trigger('reloadGrid'). You can set more additional jqGrid parameters on the same way. Before call of trigger('reloadGrid') you can optionally do some additional work like setting grid title with respect of setCaption('A text') jqGrid method. If you don't want to display jqGrid before the first click of the "search" button you can place jqGrid inside of a div with "display:none;" CSS style and use jQuery function show() to make the div visible if needed.
A code example you find in my answer on stackoverflow:
http://stackoverflow.com/quest.....19#2928819
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
50 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