selectize.js

In Shiny can a data frame be used as choices in selectizeInput?

自闭症网瘾萝莉.ら 提交于 2019-12-08 05:55:19
问题 Is it possible for the choices in selectizeInput to be rows from a data frame? If so, would the returned data be a list of items from the selected row? I have been unable to make this work. In the code below, cityInput works since the choices are a character vector; but locationInput does not work, the item list in the select box is empty. This is a common occurrence where user input requires selection based on the values in multiple columns to determine a unique row. In the example below,

Difficulty with selectize.js dropdown overflow in mobile

巧了我就是萌 提交于 2019-12-08 03:39:49
问题 So I'm creating an autocomplete search field using selectize.js. It works fantastically, unless I scale the dropdown to a small mobile screen. Any text mildly long causes it to overflow to the next line and stretch the dropdown element farther to the right that it should. In addition to the textbox growing, the icon next to the textbox grows with it. Here is a jsfiddle demonstrating the problem. If you drag the screen so that the 'Result' section is very small, you can see the overflow. On my

Remote loading data for dropdown suggestion in Selectize

狂风中的少年 提交于 2019-12-07 14:18:18
问题 I have a text input that I have selectized as tags which works fine. I can create new items and they are shown correctly. I want to remote load data in the dropdown for suggestion like on google. I followed the documentation but the json which is returned by ajax is not shown in the dropdown. The ajax call succeed since my console shows this returned json: ["New York", "New Jersey", "New Mexico", "New Hampshire"] There is just the: "Add new... " in the dropdown. This is my code with selectize

Shiny SelectInput and SelectizeInput

扶醉桌前 提交于 2019-12-07 02:25:34
I updated my Shiny library to version 1.1.0 and I noticed some very strange behavior with selectInput/selectizeInput and observeEvent/eventReactive. The problem occurs when I press backspace and clear the contents of the drop-down menu. In the previous Shiny version the backspace coupled with a eventReactive, the reactive expression wouldn't evaluate (I guess it treated this as a NULL) observe and reactive would evaluate which is desired. req() is also behaving weird, in Example 1 below if we press the backspace and clear the input, renderTable is triggered but when req(input$variable) is

In Shiny can a data frame be used as choices in selectizeInput?

雨燕双飞 提交于 2019-12-06 19:32:32
Is it possible for the choices in selectizeInput to be rows from a data frame? If so, would the returned data be a list of items from the selected row? I have been unable to make this work. In the code below, cityInput works since the choices are a character vector; but locationInput does not work, the item list in the select box is empty. This is a common occurrence where user input requires selection based on the values in multiple columns to determine a unique row. In the example below, different cities have the same name and state is used to uniquely determine a location. Pasting the two

Remote loading data for dropdown suggestion in Selectize

为君一笑 提交于 2019-12-06 00:51:05
I have a text input that I have selectized as tags which works fine. I can create new items and they are shown correctly. I want to remote load data in the dropdown for suggestion like on google. I followed the documentation but the json which is returned by ajax is not shown in the dropdown. The ajax call succeed since my console shows this returned json: ["New York", "New Jersey", "New Mexico", "New Hampshire"] There is just the: "Add new... " in the dropdown. This is my code with selectize: <script> $(function() { $('.offerInput').selectize ({ delimiter: '♥', plugins: ['remove_button'],

Add data-attribute to selectize.js options

会有一股神秘感。 提交于 2019-12-05 14:03:53
I am using selectize.js for my project. But I have problems with data-attributes. I want to add data-attributes to the select options. I have default select like this: <option data-open-balance="false" selected="selected" value="1">PNP.SI.080416</option> But When I add selectize to this select, it becomes: <div data-value="1" data-selectable="" class="selected">PNP.SI.080416</div> I see that its "item object" only get value, and text. So, how can I add other data-attributes to its item object? I've looked at docs and they say that if you want to add custom attributes to your elements, you

Disable “remove on backspace” (or remove ibeam entirely)

泪湿孤枕 提交于 2019-12-05 10:17:53
I'm trying to make a custom select box using selectize.js. So far it was easy to configure and the API supports about everything. The last thing I need to do is disable the option to remove items pressing backspace. For this I couldn't find any methods to call of properties to configure. Do you have any idea on how to achieve this? Also, another thing that would work for me will be to disable "ibeam". This is the feature that allows you to use the arrow keys to navigate between the selected items. Is this is disabled the user will be able to remove only the last item which is not a big issue

Handling dropdown on selectize

萝らか妹 提交于 2019-12-05 09:19:23
问题 I have a selectize control with 100 items. I want the control to show the dropdown only when typing. When it gets focus the dropdown should be closed openOnFocus: false When an item is selected the dropdown should be closed closeAfterSelect: true When an item is selected using tab the dropdown should be closed When an item is deleted with backspace the dropdown should be closed When an item is deleted with x(remove plugin) the dropdown should be closed How do I achieve 3, 4 and 5? My control

How to limit minimum character in selectize tags

女生的网名这么多〃 提交于 2019-12-05 07:10:35
I want to limit minimum 3 characters for Selectize tags input. Is it possible? is there any event in selectize? I had the same problem. Its as Rory has mentioned, via plugins. Its actually quite simple. The official example for tag minimum word length filtering you can find here $('#select-words-length').selectize({ create: true, createFilter: function(input) { return input.length >= MIN_LENGTH; } }); Another thing that you can do is filter the search itself //restricts the matches to fulfill MIN_SEARCH_LENGTH via the 'score' callback //see https://github.com/brianreavis/selectize.js/blob