I am working on a registration wizard that interfaces with a web application and would like to provide a typeahead control where the user enters in the name of a marina but the available marinas are returned from a rest service by the web application. I was wondering what the best approach is to do this. I see that in your typeahead sample, the list of items is set at design time. Is there a way to populate this dynamically?
Yes; I think Samuel is right (thanks for your help here, sir). What the Typeahead control expected is an Array of strings, and not an Array of objects, so we must prepare the appropriate Array to be used from our Array of objects.
P.S. Just to add something... if we can provide to the app the right Array... instead of Array of object... that's better, because we no need to do it in the app itself. In other words, if we can do it in the server's side, better. If not, we can always do it in the app, of course.
Hi, I have this working well however I would like to populate the typeahead dropdown list with a string that contains a concatenated string containing the name, city and state. (i.e. Acme Widgets Manufacturing Company, Los Angeles, California).
The issue is that the string is too long to show in the list, is there a way to introduce a line feed after the name but before the city?
i.e.:
Acme Widgets Manufacturing Company Los Angeles, California
Company #2 New York, New York
Company #3 Buffalo, New York
I tried playing around with line feeds as a special character or html with no luck
When I read your post I supose that maybe the HTML must be in fact XHTML, but, in fact I try with "br" and also works... anyway, what matter here is that you got the point. :-)
Hi,
Actually, I was a little quick to assume that was the issue as I found the same thing. I now see the script that you added to strip out the br / and replace it with a dash after the user selects the item as the typeahead control does not parse html tags but the dropdown list does.
Cheers,
Pete
Just a quick question. If you start typing in your example and type 'b' or 'br', then the dropdown list shows the br / in the dropdown list otherwise, it parses it properly. I was wondering whether there was a way to limit the dropdown list to not show any returns until the user has entered 3 or more characters? That way, they would never see this issue, also, the returned list would be smaller and more useable.
Pete
Sorry, I don't understand your answer. Is there a way to prevent the typeahead control from firing the dropdown list until at least 3 characters have been typed?
Cheers,
Pete
Sorry to confuse you, Peter... my humor sense and my english... sorry for that. The point is that the answer of everything is 42, as you probably know... (google around this if you wanted :) and the new release of App Builder (which allows to specify a minimum length of characters to show the TypeAhead list) is also the release 42 of the year. I don't know why I want to made a joke around this!
Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.
This website uses cookies only to store your preferences.