Results 1 to 3 of 3
  1. #1

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    off others' brains

    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:


    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.
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  2. #2
    King of sapila
    Join Date
    Oct 2006

    Re: MVC3, Razor, jqGrid Search Functionality

    Better moving your question to the MVC thread?
    Slow as hell.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Bristol, UK

    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


Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.