aWebDeveloper
aWebDeveloper

Reputation: 38432

jquery ui auto complete

I was using Jquery ui auto-complete with version 1.8.2 and later i shifted to 1.8.11. I started having problems.

auto complete in jquery 1.8.2

1.8.2

auto complete in jquery 1.8.11

1.8.11

$('#term').autocomplete({
        minLength    : 4,
        source        : rootPath+'/search',
        select: function(event, ui) 
        {
            window.location =  ui.item.url;
        }
    });
  1. How can i fix it
  2. and Where can in http://jqueryui.com/ i can get 1.8.2

Thanks

Upvotes: 3

Views: 1570

Answers (2)

Vishnu Vardhana
Vishnu Vardhana

Reputation: 497

For you to render a custom HTML element in Auto Complete you need to use ._renderItem.

Once you render custom data then you can capture that using select method and process it the way you want.

Use following link to learn abour custom data formatting in jquery auto-complete

http://jqueryui.com/autocomplete/#custom-data

Upvotes: 2

kevmo314
kevmo314

Reputation: 4317

From http://jqueryui.com/demos/autocomplete/:

The label is always treated as text, if you want the label to be treated as html you can use Scott González' html extension.

And the aforementioned extension is located here: https://github.com/scottgonzalez/jquery-ui-extensions/blob/master/autocomplete/jquery.ui.autocomplete.html.js.

Upvotes: 1

Related Questions