Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 814711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:33:57+00:00 2026-05-15T01:33:57+00:00

I want users to be able to filter grid data without using the intrinsic

  • 0

I want users to be able to filter grid data without using the intrinsic search box.

I have created two input fields for date (from and to) and now need to tell the grid to adopt this as its filter and then to request new data.

Forging a server request for grid data (bypassing the grid) and setting the grid’s data to be the response data wont work – because as soon as the user tries to re-order the results or change the page etc. the grid will request new data from the server using a blank filter.

I cant seem to find grid API to achieve this – does anyone have any ideas? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:33:57+00:00Added an answer on May 15, 2026 at 1:33 am

    You problem can be very easy solved with respect of postData parameter including functions and trigger('reloadGrid'). I try explain the idea more detailed.

    Let us use mtype: "GET". The only thing which standard search/filter box do after displaying the interface is appending of some additional parameters to the url, sending to server and reloading the grid data. If you have your own interface for searching/filtering (some select controls or checkboxes, for example) you should just append your url yourself and reload the grid with respect of trigger('reloadGrid'). For resetting of the information in the grid you can choose any way which you prefer. For example, you can include in the select controls which you have an option like “no filtering”.

    To be more exact your code should looks like the code from the answer how to reload jqgrid in asp.net mvc when i change dropdownlist:

    var myGrid = jQuery("#list").jqGrid({
        url: gridDataUrl,
        postData: {
            StateId: function() { return jQuery("#StateId option:selected").val(); },
            CityId: function() { return jQuery("#CityId option:selected").val(); },
            hospname: function() { return jQuery("#HospitalName").val(); }
        }
        // ...
    });
    //
    var myReload = function() {
        myGrid.trigger('reloadGrid');
    };
    var keyupHandler = function (e,refreshFunction,obj) {
        var keyCode = e.keyCode || e.which;
        if (keyCode === 33 /*page up*/|| keyCode === 34 /*page down*/||
            keyCode === 35 /*end*/|| keyCode === 36 /*home*/||
            keyCode === 38 /*up arrow*/|| keyCode === 40 /*down arrow*/) {
    
            if (typeof refreshFunction === "function") {
                refreshFunction(obj);
           }
        }
    };
    
    // ...
    $("#StateId").change(myReload).keyup(function (e) {
        keyupHandler(e,myReload,this);
    });
    $("#CityId").change(myReload).keyup(function (e) {
        keyupHandler(e,myReload,this);
    });
    

    If user change selected option in select box with id=StateId or another select box with id=CityId (with mouse or keyboard), the function myReload will be called, which just force reloading of data in jqGrid. During corresponding $.ajax request, which jqGrid do for us, the value from postData parameter will be forwarded to $.ajax as data parameter. If some from properties of data are functions, these function will be called by $.ajax. So the actual data from select boxes will be loaded and all the data will be appended to the data sent to the server. You need only implement reading of this parameters in your server part.

    So the data from the postData parameter will be appended to the url (symbols ‘?’ and ‘&’ will be added automatically and all special symbols like blanks will be also encoded as usual). The advantages of the usage of postData is:

    1. usage of functions inside postData parameter allows you to load actual values from all used controls to the moment of reloading;
    2. Your code stay have very clear structure.
    3. All works fine not only with HTTP GET requests, but with HTTP POST also;

    If you use some “no filtering” or “all” entries in the select box StateId, you can modify the function which calculate the value of StateId parameter which should appended to the server url from

    StateId: function() { return jQuery("#StateId option:selected").val(); }
    

    to something like following:

    StateId: function() {
        var val = jQuery("#StateId option:selected").val();
        return val === "all"? "": val;
    }
    

    On the server side you should makes no filtering for StateId if you receive an empty value as a parameter.

    Optionally you can use myGrid.setCaption('A text'); to change a grid title. This allow user to see more clear, that the data in grid are filtered with some criteria.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Similar Stack Overflow Question I want users to be able to search through my
In my Rails app I want users to be able to input video links
I have an app where we want users to be able to send us
I have a situation where I want users to be able to specify a
I have some pages that I don't want users to be able to access
I'm able to create an excel file using apache poi. however, i want users
I've created a User model. In #index I want to be able to filter
I have a C# project that allows users to create filters on data using
I want to be able to customize the :authenticate_user filter to include authenticating a
I want users to be able to upload files via FTP to my site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.