Drupal 7 grouping of autocomplete suggestions
I have an places autocomplete textfield. With the core drupal autocomplete i am able to show suggestions of places开发者_JAVA技巧.
Now i need to group these suggestions by type à la OS X spotlight. Example :
- Hotels (34)
- Hotel 1
- Hotel 2
- ...
- Restaurants (65)
- Restaurant 1
- ...
How do i override drupal's autocomplete to achieve this ? Or should i build this independently from drupal's autocomplete ?
(Reference: http://bitnr.drupalgardens.com/content/autocomplete-callbacks-drupal-7-or-fun-dbqueryrange-and)
I believe you only get to return a flat array, similar to D6.
I would solve this with jQuery and AJAX.
HI please check the link , i have posted my comments here with sample code http://drupal.org/node/1197448
精彩评论