Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 2 Application Framework : Browser JavaScript : Quicksearch

Quicksearch
Sugar 5.1 uses a type-ahead combo box system we call QuickSearch based around ExtJS. The Sugar QuickSearch (SQS) code resides in the file <sugar_root>/include/javascript/quicksearch.js. The ExtJS library which drives the QuickSearch is located at <sugar_root>/include/javascript/ext-2.0/ext-quicksearch.js. These two files are grouped in <sugar_root>/include/javascript/sugar_grp1.js which is loaded in all the main page of SugarCRM. A custom Ext ComboBox is used to pull data via an AJAX call to http://yourserver/SugarCRM/index.php which then accesses the file <sugar_root>/modules/Home/quicksearchQuery.php.
Note: Sugar versions 4.5.1 – 5.0.0 use a system based on wick. Sugar 4.5.0 and prior use <sugar_root>/json_server.php.
The browser will initiate an AJAX call via JavaScript to the server 700ms after the last user input takes place in the browser. A call is then made requesting up to 30 results per result set.
The first twelve results are then displayed to the user in the browser. If the user refines his search and the result set is a subset of the first call then no additional call is made. If the result set of the first call is equal to the limit (30), then an additional call will be made.
Requirement for a QuickSearch Field:
 
Custom Parameter :
sqsNoAutofill : add this string to the class of the field to disable the Automatic filling of the field on Blur.
Metadata example:
array(
'name' => 'account_name',
'displayParams' => array(
'hiddeButtons'=>'true',
'size'=>30,
'class'=>'sqsEnabled sqsNoAutofill'
)
),

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License