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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:21:14+00:00 2026-05-27T14:21:14+00:00

I’ve read this QA jqGrid filtering on the client-side using "filterToolbar" and this one

  • 0

I’ve read this QA jqGrid filtering on the client-side using "filterToolbar" and this one triggering client-side filtering at load time in a jqGrid before I posted. Is there any way to just use one text box to filter the data on the client side?

The data is loaded via the grids built in mechanizm to consume json, and I have set loadonce:true, now the question is how to implement.

Here is an example from another grid plug-in http://datatables.net/release-datatables/examples/basic_init/zero_config.html

Regards,
Stephen

  • 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-27T14:21:15+00:00Added an answer on May 27, 2026 at 2:21 pm

    I’m answering my own question but the credit goes to Oleg (The Doctor, as he in called in my office) since it was his with guidance and deep knowledge of jqGrid that I was able to complete this.

    The keys to this are two fold, you must set multipleSearch: true in the grid and then construct the proper filter based on your requirements. See the button code at the end for the filter creation. One thing to note is that I don’t perform a search until at least 2 chars have been entered into the text box.

    Side note to this is that I am going to remove the button and handle the key down event of the text box to perform the search.

    $(document).ready(function () {
    
    var grid = $('#favoriteGrid'),
                decodeErrorMessage = function (jqXHR, textStatus, errorThrown) {
                    var html, errorInfo, i, errorText = textStatus + '\n' + errorThrown;
                    if (jqXHR.responseText.charAt(0) === '[') {
                        try {
                            errorInfo = $.parseJSON(jqXHR.responseText);
                            errorText = "";
                            for (i = 0; i < errorInfo.length; i++) {
                                if (errorText.length !== 0) {
                                    errorText += "<hr/>";
                                }
                                errorText += errorInfo[i].Source + ": " + errorInfo[i].Message;
                            }
                        }
                        catch (e) { }
                    } else {
                        html = /<body.*?>([\s\S]*)<\/body>/.exec(jqXHR.responseText);
                        if (html !== null && html.length > 1) {
                            errorText = html[1];
                        }
                    }
                    return errorText;
                };
    
    grid.jqGrid({
        url: myAjaxUrl,
        datatype: 'json',
        ajaxGridOptions: { contentType: "application/json" },
        jsonReader: { repeatitems: false },
        colNames: ['Qty', 'Features', 'Item Nbr', 'Brand', 'Product', 'Supplier', 'Price', 'UOM', 'Case Pack', 'Remarks', 'Ave Weight', 'Par', 'Sort', 'Last Purchase', 'GLCode', 'ProductId', 'OldProductId', 'CategoryName'],
        colModel: [
                { name: 'Quantity', index: 'Quantity', width: 20, sorttype: "number", editable: true, edittype: 'text', editoptions: { size: 10, maxlength: 15} },
                { name: 'ProductAttributes', index: 'ProductAttributes', width: 50 },
                { name: 'ItemNum', index: 'ItemNum', width: 60, align: "right" },
                { name: 'BrandName', index: 'BrandName', width: 100 },
                { name: 'ProducName', index: 'ProducName', width: 150 },
                { name: 'SupplierName', index: 'SupplierName', width: 100 },
                { name: 'Price', index: 'Price', width: 80, sorttype: "number", align: "right" },
                { name: 'UOM', index: 'UOM', width: 80 },
                { name: 'CasePack', index: 'CasePack', width: 80 },
                { name: 'PackageRemarks', index: 'PackageRemarks', width: 80 },
                { name: 'AveWeight', index: 'AveWeight', width: 80, align: "right" },
                { name: 'Par', index: 'Par', width: 80, align: "right" },
                { name: 'SortPriority', index: 'SortPriority', hidden: true },
                { name: 'LastPurchaseDate', index: 'LastPurchaseDate', width: 80, align: "right" },
                { name: 'GLCode', index: 'GLCode', hidden: true },
                { name: 'ProductId', index: 'ProductId', hidden: true },
                { name: 'OldProductId', index: 'OldProductId', hidden: true },
                { name: 'CategoryName', index: 'CategoryName', hidden: true }
            ],
        pager: $('#favoritePager'),
        pginput: false,
        rowNum: 1000,
        viewrecords: true,
        multiselect: true, // enable multiselct
        gridview: true,
        loadonce: true, // one ajax call per 
        caption: "Products List",
        loadError: function (jqXHR, textStatus, errorThrown) {
            // remove error div if exist
            $('#' + this.id + '_err').remove();
            // insert div with the error description before the grid
            grid.closest('div.ui-jqgrid').before(
                    '<div id="' + this.id + '_err" style="max-width:' + this.style.width +
                    ';"><div class="ui-state-error ui-corner-all" style="padding:0.7em;float:left;"><span class="ui-icon ui-icon-alert" style="float:left; margin-right: .3em;"></span><span style="clear:left">' +
                    decodeErrorMessage(jqXHR, textStatus, errorThrown) + '</span></div><div style="clear:left"/></div>')
        },
        loadComplete: function () {
            // remove error div if exist
            $('#' + this.id + '_err').remove();
            // resize the grid both Heigh and Width
            //$("#grid").jqGrid('setGridHeight', Math.min(400, parseInt(jQuery(".ui-jqgrid-btable").css('height')))); // works
            //$(".ui-jqgrid-bdiv").css('height', jQuery("#favoriteGrid").css('height'));
            var gr = jQuery('#favoriteGrid');
            fixGridHeight(gr);
        },
        ondblClickRow: function (rowid, ri, ci) {
            // Popup modal dialog for details view 
        }
    }).jqGrid('navGrid', '#favoritePager',
        { add: false, edit: false, del: false, search: true, refresh: false },
        {},
        {},
        {},
        { multipleSearch: true },
        {});
    
    
    // Add Search
    $("#mySearch").button().click(function () {
        var text = $("#searchText").val();
        var postdata = grid.jqGrid('getGridParam', 'postData');
        // build up the filter
        // ['equal','not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain']
        // ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
        var myfilter = { groupOp: "OR", rules: [] };        
        myfilter.rules.push({ field: "ItemNum", op: "cn", data: text });
        myfilter.rules.push({ field: "BrandName", op: "cn", data: text });
        myfilter.rules.push({ field: "ProducName", op: "cn", data: text });
    
        $.extend(postdata, { filters: JSON.stringify(myfilter) });
        grid.jqGrid('setGridParam', { search: text.length > 2, postData: postdata });        
        grid.trigger("reloadGrid", [{ page: 1}]);
    });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.