hgAutocomplete
public abstract class hgAutocomplete
| Field Summary | |
|---|---|
| string | Determines the ajax type made to the server. |
| bollean | When set to true enables client side caching of the results. |
| mixed | Set the encoding |
| string | the font size of the autocmplete default is 11px. |
| string | Determines the height of the autocomplete elemnt. |
| string | Defines the select command for obtaining the data from the database. |
| boolen | Determines if the data should be loaded at once from the SQL siurce. |
| string | Determines if the content in autocomplete should have a scroll. |
| string | Set the search type for the LIKE SQL operator. |
| mixed | |
| string | Info about the version |
| Constructor Summary | |
|---|---|
| void | __construct(resource db) Constructor |
| Method Summary | |
|---|---|
| boolean | Check if the autocompleter is already created so that we can do various things like data export. |
| mixed | getOption(string -, mixed option) Return the the requested option of the autocomplete |
| boolean | setOption(string option, mixed value) Set the desired option for autocomplete. |
| void | setEvent(string event, string code) Set a JavaScript event for the autocomplete. |
| none | setSource(mixed source) Set the source need for autocomlete to send a data. |
| void | setLength(mixed num) Set the limit of the requested data in case of SQL command |
| object | Return the result for the autocomplete as PHP object. |
| string | renderAutocomplete(string element, Main method which do everthing for the autocomplete. |
public string $ajaxtype = "GET"
Determines the ajax type made to the server. Defaut is GET. Can be a POST
public bollean $cache = false
When set to true enables client side caching of the results. This prevent multiple queries to the database. Please use with care.
public mixed $encoding = "utf-8"
Set the encoding
public string $fontsize = '11px'
the font size of the autocmplete default is 11px. Can be in any measure.
public string $height = "110px"
Determines the height of the autocomplete elemnt. Work only if $scroll option is set to true.
public string $higridSC = ''
Defines the select command for obtaining the data from the database. Usually this type of command contain the SQL LIKE operator. If the command contain where clause we suppose that this command contain LIKE operator. The serched fields should comtain ? plece holder in order to search om the term element send from the autocompleter. Example: SELECT field1, field2 FROM table WHERE field1 LIKE ? OR field2 LIKE ? As seen you should place a placeholder on the serched fields. The class add the term element automatically to the query. For additional information see the documantation
public boolen $loadAll = false
Determines if the data should be loaded at once from the SQL siurce. Also when set to true only one requrest is done and the data then is stored at client side. No more requests to the server.
public string $scroll = false
Determines if the content in autocomplete should have a scroll. Use this option with the height option - see below. If this option is not set the content will have height equal of the responce rows.
public string $searchType = "startWith"
Set the search type for the LIKE SQL operator. The possible values are startWith - set LIKE value%; contain - set LIKE %value%; endWith - set LIKE %value;
If the value does not match any of the above setting the SQL command is interpreted as it is without adding any additional strings.
public mixed $strictcheck = true
public string $version = '2.1'
Info about the version
public void __construct(resource db)
Constructor
public boolean isNotACQuery()
Check if the autocompleter is already created so that we can do various things like data export.
public mixed getOption(string -, mixed option)
Return the the requested option of the autocomplete
public boolean setOption(string option, mixed value)
Set the desired option for autocomplete. For a full list of the option refer the documentation
public void setEvent(string event, string code)
Set a JavaScript event for the autocomplete. For all the possible events refer the documentation
public none setSource(mixed source)
Set the source need for autocomlete to send a data. Can be a string or array. If the option is string then this is the url from where to obtain the data.
public void setLength(mixed num)
Set the limit of the requested data in case of SQL command
public object queryAutocomplete()
Return the result for the autocomplete as PHP object. Determines automatically the placeholders (?) used into the SQL command
public string renderAutocomplete(string element, target, boolean script, boolean echo, boolean runme)
Main method which do everthing for the autocomplete. Should be called after all settings are done. Note that in one file we can have more than one autocomplete definitions. Construct the autocomplete and perform Query operations.