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_TopicIcon
passing parameters to jqGrid
07/01/2010
20:54
Avatar
bfancett
Canton, MI
New Member
Members
Forum Posts: 2
Member Since:
07/01/2010
sp_UserOfflineSmall Offline

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

12/01/2010
16:53
Avatar
Tim
Guest
Guests

Why not refactor the grid into a partial and load it via ajax when the user fills out the form fields and clicks submit

01/07/2010
13:54
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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 

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information