I'd like Tokeninput to skip the help text and search for tokens right away.

I have a pretty short list of tokens, so I'd like to display them to the user, rather than have the user try and guess what are the right tokens to choose.

Seem's there's not an option for this so looks like I'll have to hack it?

Any hints as to what method I need to override and how?

有帮助吗?

解决方案

Line 195ish there's a show_dropdown_hint(), which is what you want to replace.

You'll need to replace it with populate_dropdown(query,results) and show_dropdown().

For the populate_dropdown() parameters, you should use an empty string for query - as that only relates to the section of the string which is bolded in the text, and results should be a JSON array (?) of all your tokens.

Not tested at all, but that's a rough guess, hope you can figure anything else out!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top