typeahead.js is a fast and fully-featured autocomplete library
Demo : http://twitter.github.io/typeahead.js/examples/
Source : https://github.com/twitter/typeahead.js
Name of type : olix_autocomplete
// In class form
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('my_autocomplete1', 'olix_autocomplete', array(
'dataset' => array('local' => array('toto', 'titi', 'tutu'))
));
// With attributes
$builder->add('my_autocomplete2', 'olix_autocomplete', array(
'config' => array(
'display' => "'nom'",
'limit' => 10,
'minLength' => 2,
),
'dataset' => array(
'remote' => array(
'url' => $this->generateUrl('my_route_xxxxx', array('term' => 'TERM')),
'wildcard' => 'TERM'),
),
),
);
}
type : boolean
, default : true
If true, when suggestions are rendered, pattern matches for the current query in text nodes
type : boolean
, default : true
If false, the typeahead will not show a hint.
type : integer
, default : 2
The minimum character length needed before suggestions start getting rendered
type : array
, default :
For overriding the default class names used. See for more details
type : integer
, default : 8
The max number of suggestions to be displayed
type : string
, default : none
For a given suggestion, determines the string representation of it
Bloodhound is the typeahead.js suggestion engine