Content - News Menu - Ressources Menu - Sitemap - Share your code - Code library - Reference
Formidable is part of the TYPO3 Project and is supported by Ameos
The renderlet :AUTOCOMPLETE is very useful on search engines. It helps the user to find out the information he needs, by proposing him something when he's typing (on mouse press).
So, this control will be usually used into a renderlet:SEARCHFORM or even in collaboration with a simple renderlet:BUTTON.
You can see below a common example of autocomplete on google search engine :
The list of choices is generated dynamically, based on Ajax Requests, and it is triggered when the user types something into the input text. So, the time of response is optimal.
What is great with this control is that you can specify a /datasource to the list of choices. In fact, this option is required to be set. So, when the user types something, than a query is made on the database in order to update the list of proposals. You can also order and limit the list of choices from your datasource.
It is required to specify the list of /childs to be rendered on this control and how to be rendered with the aid of a /template file. You must specify at least one child for the rendering of this control.
All these configurations makes from this renderlet a powerful control.
| path | data type | req | default | uobj | description |
|---|---|---|---|---|---|
| all |
This control has applied all the common properties of renderlet. See renderlet:* section for the complete list of common properties to use. | ||||
| searchonfields | string | X |
Specify the list of fields from /datasource, comma separated, where will be searched the input text. Example:
| ||
| searchtype | string | X | inside |
Set up the search type. The available choices are:
| |
| timeobserver | int | X | 0.75 | Set up the time passed before each execution of Ajax Request (in milliseconds). | |
| itemstyle | string |
Set up the inline styles that must be applied to each item of this choices list. Example:
| |||
| itemclass | string | ameosformidable-rdtautocomplete-item | Set up the name of CSS class to apply to each item from current choices list. It is recommended to use a class name instead of inline styles. | ||
| selecteditemclass | string | selected | Set up the name of CSS class applied on an item when the mouse is passing over it. | ||
| datasource/ :
Specify which datasource is used to populate this renderlet:AUTOCOMPLETE. Example:
| |||||
| datasource/use | string | X |
Set up the name of datasource:* where will be searched all the choices. It is also required to define /childs and /template sections in order to be able to display the list of choices. | ||
| datasource/limit | integer | 5 | Specify the max number of items to show on this list of choices. | ||
| datasource/orderby | string | tstamp | Specify the field used to sort the list of choices. | ||
| datasource/orderdir | string | DESC | Specify the way how the list of choices will be sorted: ASC or DESC. | ||
| template/ :
Set up the template file used to design the /childs area of this renderlet:AUTOCOMPLETE. The /template and /childs sections are only used to design the list of choices, and not the linked input text. For, the input text, consider the use of /style or /class properties. Example:
| |||||
| template/path | string | X | X | Set the absolute path of template file. | |
| template/subpart | string | X | X | Set the name of subpart used to render the list of choices. | |
| template/alternaterows | string | X | X |
Set the name of subparts used to render each type of item for the current choices list. In the following example, all the odd items is rendered using the subpart ###ODD_ROW### and all the even items by using ###EVEN_ROW###:
| |
| childs/ :
Set up the list of childs to display into this renderlet:AUTOCOMPLETE, according with his datasource. It is required to define at least one child in order to have a rendered list of choices. You can simply customize the design of choices with the aid of a template file (see the section /template). So, here you can describe the list of childs for this control; where each child represents a renderlet:* and allows the nesting of elements inside your application. Example:
| |||||
Provided by Ameos