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 4541102
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:10:55+00:00 2026-05-21T15:10:55+00:00

It seems there have been a few questions here regarding this subject, and they

  • 0

It seems there have been a few questions here regarding this subject, and they have some great answers, but it seems that my case is a little different. I need to filter the records displayed in a jqGrid, but entirely client-side.

For a number of reasons, the best way for me to populate my grid is with an array that’s emitted directly into the JavaScript on the page. The grid itself doesn’t interact with the server at all. I have some custom AJAX happening in various grid events, but that’s it. (Basically, I’m integrating this with an existing set of available services which can’t change significantly.)

What I’m looking to do is filter the grid based on a simple text input and button. My page has the text input, the button, and a table (which becomes the grid on document ready). I’d like to bind to the click event of the button (normal jQuery event binding, nothing special) and use the value from the text input as a display filter on the jqGrid.

By “filter” I mean to display only the records which contain a match (in any field) for the text in the input. Then, to display all records, just empty the input and click the button again. Additionally, the grid is multi-select and the selections need to persist through filtering. I just need to be able to hide the rows which don’t match what’s in the input.

Is this possible?

  • 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-21T15:10:55+00:00Added an answer on May 21, 2026 at 3:10 pm

    To filter local grid you should only fill filters property of the postData parameter of jqGrid and set additionally search:true.

    To save selection of the grid you can use reloadGrid with additional parameter [{page:1,current:true}] (see here).

    The corresponding code can be the following

    $("#search").click(function() {
        var searchFiler = $("#filter").val(), grid = $("#list"), f;
    
        if (searchFiler.length === 0) {
            grid[0].p.search = false;
            $.extend(grid[0].p.postData,{filters:""});
        }
        f = {groupOp:"OR",rules:[]};
        f.rules.push({field:"name",op:"cn",data:searchFiler});
        f.rules.push({field:"note",op:"cn",data:searchFiler});
        grid[0].p.search = true;
        $.extend(grid[0].p.postData,{filters:JSON.stringify(f)});
        grid.trigger("reloadGrid",[{page:1,current:true}]);
    });
    

    I made the demo for you which filter for two columns ‘Client’ (‘name’) and ‘Notes’ (‘note’) you can extend the code to search in all columns which you need.

    Depend on what you exactly mean with the saving row selection you can need to save the current selection from the selarrrow in a variable and restore the selected rows with respect of setSelection method.

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

Sidebar

Related Questions

I see that there have been similar questions asked here regarding wrapping unmanaged C++
I know this questions has been asked a few times here. But these seem
This question has been asked few times here and there, but you see all
There have been similar questions but the answers weren't what I was looking for.
There might be an easy solution here, but it seems to have me tripped
There seems to have been a backlash from users when Spotify (link below) required
I have a survey on a website, and there seems to be some issues
I am trying to read command lien argument but it seems there is some
I know there are plenty of questions here already about this topic (I've read
I am a new iphone learner. I have been reading tutorials but it seems

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.