How to search in JQGRID?

0

I have some problem, when wanting to do a search my jqgrid only searches for a column and no more, I want to search for 3 fields and only one column is used for search. any ideas? I want to do the search in a normal way on the table, I already try what it says in the documentation with the search: true in each column that I want, but that only enables or disables the search box.

    
asked by Eli Alejandro S. Perez 26.07.2018 в 01:08
source

1 answer

0

Here I leave a function that allows me to search by any field shown in your grid:

Defining the grid and the search input:

<input type="text" id="#search_cells">
<table id="gridEjemplo"></table>
<div id="pagerEjemplo"></div>

in your js file

        //funcion Buscar
        var timer;
        $("#search_cells").on("keyup", function() {
            var self = this;
            if(timer) { clearTimeout(timer); }
            timer = setTimeout(function(){
                //timer = null;
                $("#gridEjemplo").jqGrid('filterInput', self.value);
            },0);
        });

With this function you will search for any field shown in your grid .. I hope it serves you .. !!

    
answered by 26.07.2018 в 01:30