Global Search

QuestionsGlobal Search
Gabriel Robles asked 7 years ago


I bought the product last week to implement on my website. Everything works OK but I need a functionality to simplify the search of my clients in the table.

I need a GLOBAL SEARCHING functionallity, like a text box where you can write your search and it filters by any value in any column.

There is an axample from PHPGRID.COM:

Is it this possible to have this functionality in this product?



8 Answers
Abu Ghufran answered 7 years ago

Yes this is doable. You can refer code of demos/search/search-form.php demo.
It allow external form to do search on your desired fields.

Gabriel Brezuica answered 7 years ago

Thanks Abu!
Just another small thing. Could you please let me know how to "Autofilter"? I'd like the filter applies once I write down without touching "Filter" Button.


Abu Ghufran answered 7 years ago

Instead of

You can change it to

I've not tested it but it's plain JS/Jquery code.

Gabriel Brezuica answered 7 years ago

Dear Abu,

I have two more question realted to the above.

1) How do I make the search case-insensitive?

For example:

I have a column "Description" with a register like "Hand Blender"…
When I look for "hand blender" or "HAND BLENDER" there are no results. But yes when I look for "Hand"or "Hard Blender".

I'm using the demo: "demos/search/search-form.phps" and I'm loading the data from an array. I'm also using the Full Version of the Framework. When I use your demo, the search is case insensitive, but not when I use it in my case. I think that it is because i'm loading from array and your not.

The jQuery code for the filter is:
jQuery("#search_text").click(function() {
grid = jQuery("#list1");

// open initially hidden grid
// $('.ui-jqgrid-titlebar-close').click();

var searchFiler = jQuery("#filter").val(), f;

if (searchFiler.length === 0) {
grid[0] = false;
f = {groupOp:"OR",rules:[]};

// initialize search, 'name' field equal to (eq) 'Client 1'
// operators: ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
// equal, not equal,


grid[0] = true;


return false;

2) How do I make the search be anywhere in the String and not from the beginning?

For example:

In the column "Products" I have a register like "KA-CM700, KA-CM600, KC-CT250, KR-CM100". When a search, for example, "KC-CT250", there are no results. I realized that the search is from the beginning of the String.

Please, can you help me with this?

Thanks a lot!


Abu Ghufran answered 7 years ago


1) Perhaps due to mysql table collation:
Without changing database you can set:
$col["dbname"] = "trees.`title` COLLATE UTF8_GENERAL_CI";
It will then use above string in WHERE clause field name.

2) f.rules.push({field:"certificate",op:"bw",data:searchFiler});
Change "bw" to "cn" (begins with to contains)

Gabriel Brezuica answered 7 years ago


The solution for the 2) point its ok, thank you a lot!

But with 1) … I think the problem is not in the query, because this is done beforehand and then I load the data from an array. I thought of a possible solution, which is to use an extra non-visible column with the Strings in lowercase (This is made easy with the function strtolower ()). Then, when typing the search, transform what is entered in the text box to lowercase, so that there is always a match.

In the code of my previous post (made in Javascript), How can I transform to lowercase the text to Search?

Thank's a lot.


Gabriel Brezuica answered 7 years ago

Abu, I solved the problem. Just setting $grid["ignoreCase"] = true; the search turns case insensitive.


Abu Ghufran answered 7 years ago

Glad to know its fixed. I didn't knew you are using array based grid.

Your Answer

7 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?