bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Add remote sources support for typeahead

Open marcboeker opened this issue 14 years ago • 108 comments

Hi Mark,

the new typeahead component is awesome. But I often have to implement an autocomplete that is fetching data from a remote source. Would it be possible to add a callback, that I can use to query the remote server and return a set of items that match the entered query?

function(query) {
    // Do some fetching and return an array of items.
}

The jQuery UI autocompleter offers returning an array of objects. This is very helpful, as you would often like to display a human friendly title to the user and set an ugly ID in the background as the field's value.

[{title: 'Look at me', value: '12345xyz'}, {title: 'Foo Bar', value: '654321abc'}]

I know, this increases the complexity of the typeahead component, but makes it on the other side very useful.

Thanks Marc

marcboeker avatar Jan 28 '12 08:01 marcboeker

That's not something I'm likely going to get in for 2.0 - but maybe the next release

fat avatar Jan 28 '12 09:01 fat

I think its very good ideas but given the pressure they are under currently to release 2.0 tomorrow and lots of other issues on current 2.0 I think its better to slate this for a later release.

andriijas avatar Jan 30 '12 19:01 andriijas

yes it would be nice for a next version.

Merg1255 avatar Jan 30 '12 19:01 Merg1255

That said there is an open merge request of this at https://github.com/twitter/bootstrap/pull/1433 so I think there is a good chance getting it in sooner than later :)

andriijas avatar Jan 30 '12 19:01 andriijas

+1

frolic avatar Feb 02 '12 09:02 frolic

+1

stefanozoffoli avatar Feb 02 '12 12:02 stefanozoffoli

:+1:

dbpolito avatar Feb 02 '12 12:02 dbpolito

+1

BobWalsh avatar Feb 02 '12 17:02 BobWalsh

+1

mattkennedy avatar Feb 02 '12 18:02 mattkennedy

+1

t1mmen avatar Feb 03 '12 11:02 t1mmen

+1

S33G avatar Feb 03 '12 11:02 S33G

+1

huzzi avatar Feb 03 '12 17:02 huzzi

+1

suigintou avatar Feb 04 '12 17:02 suigintou

+1

bretrzaun avatar Feb 04 '12 23:02 bretrzaun

+1

epochwolf avatar Feb 05 '12 03:02 epochwolf

+1

nishadmusthafa avatar Feb 05 '12 03:02 nishadmusthafa

+1

derrickontiveros avatar Feb 05 '12 04:02 derrickontiveros

+1

pochy avatar Feb 07 '12 03:02 pochy

+1

octohq avatar Feb 07 '12 03:02 octohq

+1

krmcbride avatar Feb 08 '12 05:02 krmcbride