This topic is locked

Search auto suggest

12/8/2011 4:39:58 AM
PHPRunner General questions
G
giorgiots author

Hi,
I'm trying to disable the automatic lookup in the search panel of a specific list page with nio success. I've tried to set the $useajax and $suggestAllContent to false in the _search page and in the appsettings.php but it has no effect. Am I missing somthing?
Also is it possible to apply a minimum search length (4 characters) in the search panel?
thanks
P.S. phprunner built 9948 on windows 7 32bit

C
cgphp 12/8/2011

Check this page for search suggest setting: http://xlinesoft.com/phprunner/docs/choose_fields.htm
To apply a minimum search length in the search panel, enter the following code in the "List page: before process" event:

if(isset($_GET['ctlSearchFor']) AND strlen($_GET['ctlSearchFor']) < 4)

{

header("Location: tablename_list.php");

}
G
giorgiots author 12/8/2011

Thanks for the quick response.
I've seen that page in tha manual but it doesn't really say how to disable the ajax suggest feature

By default, search suggest results include all values in which the search phrase presents. If you want to be shown only those values that begin with the search phrase you should change the $suggestAllContent variable value in the include\appsettings.php file to false.

Note: if a field is not shown at least on one page (list/view/edit/export etc.), then the field values are not shown in search suggest results. This is done to secure the confidential data like passwords and credit card numbers.


I've also tried the code you provided but in all cases (search string <=>4). The page "stucks" in displaying the loading box (with the display loading box feature enabled or disabled) and no querry is sent to the sql.
thanks

C
cgphp 12/8/2011

If you want to disable the "Search suggest" feature, uncheck the "Search suggest" option in the "Search settings" page. Check the "Search settings" paragraph for more info: http://xlinesoft.com/phprunner/docs/choose_fields.htm

G
giorgiots author 12/8/2011

Well...that happens when you're working continuously for hours <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=62930&image=1&table=forumreplies' class='bbc_emoticon' alt=':ph34r:' />
Any suggestions why the code for the search limit behaves that way?

C
cgphp 12/8/2011

Uncheck the "AJAX search, pagination and sorting" option in the "List page settings" page. Check the "AJAX-based pagination/sorting/search" paragraph for more info: http://xlinesoft.com/phprunner/docs/ajax_features.htm