how to implement search hint? #1418
Replies: 2 comments 3 replies
-
This seems like a reasonable request considering AI/ML domain is known for large amounts of data. However, seems like there is currently no option that would provide as smooth UX as I would like. We might implement a dedicated |
Beta Was this translation helpful? Give feedback.
-
I have found how to implement type hint in my scenario - using a combobox, inject javascript to emit value change event to server when user is typing, then (most important) populate its choice prop, instead of re-draw the card. Updating prop, instead of re-draw the whole card, has been documented in the guide, I've just overlooked it. in case someone else encountered same problem, here is the code:
in your view, implement page_script (which is js too) to do event binding:
then inject page_script, with utils.js into your view's meta:
then handle the event with
|
Beta Was this translation helpful? Give feedback.
-
Usually to implement a search box with hint, you'll need a input box, and provide
list
property, then h5 input box will do the hint and autocomplete for you.In h2o wave, I found I can use combobox to do the trick, the issue in my scenario is, we're going to prompt user from a list with length about 10k (or even more).
In a traditional b/s arch, we'll use ajax to pass user's partial input to server, then server do a fuzzy match, return result to
select
control, then prompt/hint is available. However, in h2o wave, seems like without refresh page/card, I'm not able to populateoptions
property ofselect
control. But if I re-draw the page/card, then user have to re-type same char to trigger prompt/hint, since re-draw the page/card cause the control lose former typed chars.Any idea?
Beta Was this translation helpful? Give feedback.
All reactions