-
Dec 16th, 2013, 03:16 AM
#1
Thread Starter
Randalf the Red
MVC3, Razor, jqGrid Search Functionality
We are already using jqGrid to display data (including pagination) in a few of our MVC3 views.
Being tired of the long and seemingly complex script required for the jqGrid, I searched on the net for an easier option and came across MvcJqGrid - which simplifies life a lot.
So far so good. I now have a listing view which uses MvcJqGrid plugin to render a jqGrid, fetch data from an actionmethod and display it in columns and rows, with paging.
Then I came across this link to implement search in the first row of the grid:
http://xprog.blogspot.in/2012_07_01_archive.html
That's a nice article, and I immediately implemented it in my code. The view shows a list of users in the system. The first column is the login name, and I added a dropdown search for this column. The controller writes some arbitrary values to the ViewBag which are used to fill the dropdown. When the view is rendered, I see the options in the dropdown and am able to select one of them. After selection the script does call the correct action method. However in this action method, the grid.IsSearch parameter is false.
This parameter is expected to be false in the beginning and then if the user tries to search on any column, this parameter is expected to be set to true. But for a dropdown based search, it does not work.
After breaking my head over this problem for a few hours, I finally implemented a textbox search in the next column, and it works perfectly. Now the situation is for the dropdown search, the search functionality doesn't work, but for the textbox search it works. There are no Javascript errors to speak of.
How do I debug this problem? And how do I fix it?
I am using VS 2010, MVC 3 with Razor and testing with IE.
-
Dec 16th, 2013, 09:47 PM
#2
Re: MVC3, Razor, jqGrid Search Functionality
Better moving your question to the MVC thread?
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Dec 22nd, 2013, 07:27 AM
#3
Re: MVC3, Razor, jqGrid Search Functionality
Thread moved from the 'MVC' forum
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|