how do I create autocomplete that works exactly like how the tags work in here? (stackoverflow)?
There are autocomplete plug-ins but not ones where you can separate your tags by commas and do autocomplete for each tags.
You'd need Token Fields
http://railscasts.com/episodes/258-token-fields
Try the jquery autocomplete the back-end is done in PHP though you can convert it on rails
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
Here are some demos
http://jquery.bassistance.de/autocomplete/demo/
Related
I would like to add select2 to a smarty template in a shopware 5 plugin, in order to be able to type and search for a value in the dropdown. I was searching for it but found nothing relevant. As I see, there is only a standard <select> which is a html select, and {html_options} there is no way to type and search for what you are looking for in the dropdown, right? Is it possible to add select2 to smarty? If yes, could you please pont me to the rigth direction? If it's not possible or too complicated, what would be a better alternative? Is it possible in Shopware 6? (I wanted to ask this question actually on stack exchange, but I can't...)
Unfortunately you did not mention what you try so far.
I believe you have to add the Javascript resources as in https://select2.org/getting-started/installation and add the .select2() call in the on ready.
The HTML of the select can stay the same - the select2 script will transform this.
Is it possible to extend rich:select or h:selectOneMenu to enable multiple selection? I am looking for a jsf component which looks like the jQuery Chosen plugin.
The component should let me select multiple options from the drop down.
Please note that I can not use h:selectManyMenu or list box because of the specific requirement.
Note: just saw the tags field below the description box while posting a question. I am looking exactly for the same functionality, except that I want a JSF component, not a js plugin.
Any suggestion is highly appreciated. Thanks in advance.
I would use that jQuery Chosen plugin and do something like this:
use jQuery to apply it to your select
use jQuery to get the selected data
pass the data to the backing bean via a hidden input field
There may be 'pure JSF' ways but it looks like more work. If you find something interesting let me know.
is there any way (or plugin) to display editable combobox? I have a set of options, but I would like to give possibility to enter custom value.
I've searched the documentation, and I can't find way to do this. I made workaround with javascript, but I'm looking for more elegant solution.
I'm pretty sure that there simply is no HTML form element that does this, and so Rails can't provide you with a helper. As you said, you can work with JS to create something similar (and there should be JS libraries/plugins already out there), or you could just use a select element and add a text field next to it for new values.
HTML5 specification doesn't define such an element. So you may either continue using JS, either try to use autocomplete feature of an input element (although it is not exactly what you want and doesn't compatible with old browsers).
I'd like to be able to use the same Freebase autosuggest plugin but with the added ability to add multiple entries to a single field separated by commas.
I know that they are using some variation on jquery-ui autocomplete but can't figure out how to do this using their modified JS. http://www.freebase.com/docs/suggest
Any ideas?
Or use something like Jquery Tag-it
I'm not such a fan of using datetime_select. I think it renders ugly and isn't easy to deal with on post back.
How do most people deal with it? Wouldn't it be easier to use a plain textbox and use javascript to validate the input as a date? I will be persisting it as a DateTime value.
I used a text box with a jquery datepicker and all was well in the universe.