Bouilleoliv / flexigrid

Automatically exported from code.google.com/p/flexigrid
0 stars 0 forks source link

Is wildcard search possible in p.query? #98

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Click on search icon
2. Enter string to search for in textbox
3. Hit the ENTER key

Q: What is the expected output? What do you see instead?

A: I can search only for EXACT matches to the search string, and it gives 
results.

What version of the product are you using? On what operating system?
v 1.1, Windows Vista

I'd like the search function to provide wildcard flexibility, but I'm not able 
to figure out how to manipulate the code to provide this. How is the query 
being submitted? Shouldn't I be able to add a simple '%' or some other 
character to both ends of the string to produce a broader search?

Original issue reported on code.google.com by gtr1...@gmail.com on 18 Jan 2012 at 7:12

GoogleCodeExporter commented 8 years ago
Not sure how you're using the grid, but I'm using JSON from MySQL, so all I've 
done is change the...

$searchSql = ($qtype != '' && $query != '') ? "WHERE $qtype = '$query'" : '';

...to...

$searchSql = ($qtype != '' && $query != '') ? "WHERE $qtype LIKE '%$query%'" : 
'';

That's worked well.

Original comment by cyborg10...@gmail.com on 10 Jul 2012 at 5:07