Is there a possibility for the ngx-bootstrap typeahead to still give suggestions for more values after some values already picked? - ngx-bootstrap

When having for instance an array of possible values ['red', 'green', 'blue', 'yellow'], applying typeahead directive on an input text field and typing 'r' it would give suggestions of red and green. Let's say you picked red and it got entered to the input. Is it possible to type space or other delimiter and still type to get typeahead suggestions again? Basically I'm asking if there is a functionality to have typeahead suggestions for multiple possible values.

Actually I figured there is no such functionality. I submitted a pull request to the maintainers of the ngx-bootstrap. Hopefully they will add it and everyone will have a possibility to use the new feature.

Related

Multiple user inputs and autocomplete in Plotly Dash

I'm searching for a way to have suggestions "persisting" in a input widget so that user can use suggestions to create more complex strings.
E.g. if I were to create this list of possible input values:
html.Datalist(id='browser', children=[
html.Option(value="apple"),
html.Option(value="pear"),
html.Option(value="banana")
]),
(and say parameter multiple is set to True (see Dash input widget documentation))
user wouldn't be able to use the suggestions/autocomplete to create more complex strings, for instance:
apple pear and tomatoe
where the fruits names would be suggested.
I spent a great deal of time searching online but couldn't find out anythin hint on this. Any suggestion/direction much welcome.

request yadcf AND vs OR option for multi_select

Searching for an answer I found ambiguous multi_select filter - AND and OR condition - javascript and looked in the code. I don't see any way to have the multi_select support AND (intersection) and OR (union, the default).
Consider the Tags column in http://yadcf-showcase.appspot.com/DOM_source_select2.html. I would like to see a checkbox, or better a toggle button (not sure the best text, maybe AND and OR as defaults, but even better if the text is configurable) to set behavior.
In this case, assume Tags is multi_select and set to Tag1, Tag2. AND function would show only first two rows. OR function (default) would show all rows except 7 and 10.
I'm not sure this could be achieved with multi_select_custom_func as I'm not sure how to implement the toggle button.
Right now you can use only one AND / OR but not both (with the help of multi_select_custom_func) , but you can open an enhancement request asking for adding checkbox (with configurable label) which will allow you to implement different logic when checked / unchecked inside your multi_select_custom_func implementation

Bug in Google Sheets Formatting

I believe I may have found a bug in Google Sheets formatting or else my preferred option is I'm doing something wrong! * Brief rant - I find GridRange a PITBS!! Rant over.
I'm simply trying to format a cell and make the text bold. I send the following JSON request:
{"requests":[{"repeatCell":{"range":{"startRowIndex":1,"endRowIndex":"2","startColumnIndex":1,"endColumnIndex"
:2,"sheetId":0},"cell":{"effectiveFormat":{"textFormat":{"bold":"true"}}},"fields":"*"}},{"repeatCell"
:{"range":{"startRowIndex":7,"endRowIndex":"8","startColumnIndex":1,"endColumnIndex":7,"sheetId":0},"cell"
:{"effectiveFormat":{"textFormat":{"bold":"true"}}},"fields":"*"}}]}
And the values in the cells disappear?? I know the values are there because if I omit this styling code then nothing is altered and the values remain. What am I doing wrong? (For ref the fields here are B2:B2 and B8:G8). Any help gratefully appreciated.
I am sending this through the JS API but believe I have seen the same through the PHP too.
You are setting the fields parameter to *, which means, "I want to set every field.". Since you don't supply a value but said you want to set each field, the values are being reset to their defaults (which is empty).
If you only want to apply formatting, you need to set the fields parameter to just the format fields, e.g userEnteredFormat. See the documentation on field masks for more info.
Note also that you're attempting to set effectiveFormat, but per the reference docs that field is read-only.

How can I let user input a value not listed in a pull-down list?

This is really a "best practices" question: Assume I have a dynamically generated pull-down list populated with suggested values (e.g. [Vanilla, Strawberry, Chocolate]). How do I give the user the option of selecting one of the suggested values OR inputting a new value (e.g. "Rocky Road")?
One approach would be to populate the list with a None of the Above entry ([Vanilla, Strawberry, Chocolate, None of the Above]) and write my controller so that if None of the Above is selected, it will then render a form with a text field instead of the pull-down. But that feels horribly clunky.
Is there some elegant GUI technique for this sort of thing, perhaps using JQuery?
I suggest you to use simple text input with jquery autocomplate plugin don't use pull-down list. Autocomplate can work with datas you populated. If user inputs a new value, in controller use find_or_create_by dynamic activerecord method.

How to get this sort of format using dojox TableContainer?

I need to have something like :
textbox
textbox button
checkbox
I am using the dojox.layout.TableContainer to contain the elements.
The code I wrote is in this fiddle - http://jsfiddle.net/sNACz/71/
I cant seem to get the format right. The class and age boxes are indented to the right. How can I fix this?
you can use cols to modify the number of columns of yout Table, for example 3, 6, any number you need... and tweak the labelWidth a bit : http://jsfiddle.net/sNACz/85/
I hope this helps, also note that you can play with colspans if needed too :)
TableContainer is quite flexible, as long as you do not try removing fields after it has started.
I guess in your case a cols: 2 should be enough, since you are nesting tableContainers... Play with it a bit, and do not hesitate checking the code for more possibilities (colspans etc)...