selectize.js

R shiny updateSelectizeInput custom HTML tags for labels

丶灬走出姿态 提交于 2019-12-24 01:19:04
问题 Is there a way to use HTML tags (e.g. h6) for updateSelectizeInput (which is working for selectInput, see code below)? With the code below simply using h6("Label") in the updateSelectizeInput [object Object] is shown as output. rm(list = ls()) library(shiny) ui =fluidPage( selectizeInput('DropDownSelectize',choices=NULL,label=""), selectInput('DropDownSelect',choices = c("choice1","choice2","choice3"), label=h6("Label")) ) server = function(input, output, session) { observe({

How to make a specific option unselectable programmatically with Selectize.js?

安稳与你 提交于 2019-12-23 09:01:30
问题 I have a select with several options and I try to make some of the options unselectable programmatically. For instance, my code is : <select> <option value="1">Value 1</option> <option value="2">Value 2</option> <option value="3">Value 3</option> </select> <script> $('select').selectize(); </script> My question is: how can I make to get option "2" disabled (i.e. not displaying and not selectable) programmatically? -- I tried this code... $('select')[0].selectize.$dropdown_content.find('[data

Shiny SelectInput and SelectizeInput

眉间皱痕 提交于 2019-12-23 01:35:18
问题 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

Add data-attribute to selectize.js options

纵然是瞬间 提交于 2019-12-22 07:59:37
问题 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

TypeError: $(…).selectize is not a function

青春壹個敷衍的年華 提交于 2019-12-22 05:41:26
问题 I installed the "selectize-rails" gem into my rails app, and I'm trying to get it to work. I keep getting this error in my web console: TypeError: $(...).selectize is not a function and nothing happens in the browser. Here's the code I have so far, following the "Email Contacts" example from this page: http://brianreavis.github.io/selectize.js/ views/emails/new.html.erb <script type="text/javascript"> $(document).ready(function() { console.log( typeof $.fn.selectize === 'function'); // true

How to limit minimum character in selectize tags

☆樱花仙子☆ 提交于 2019-12-22 05:19:16
问题 I want to limit minimum 3 characters for Selectize tags input. Is it possible? is there any event in selectize? 回答1: 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

How do I set the selectize.js option List programmatically

╄→гoц情女王★ 提交于 2019-12-20 09:12:47
问题 I know how to set the optionList on Initiliaztion but how do I set it programmatically? I have an inviteList Array. $("#select-invite").options(inviteList); 回答1: You can use load method to set options via programmatic API. You may also want to call clear and clearOptions methods to reset selected values and old options. Here is how to put it all together: var selectize = $("#select-invite")[0].selectize; selectize.clear(); selectize.clearOptions(); selectize.load(function(callback) { callback

force selectize.js only to show options that start with user input

你。 提交于 2019-12-12 19:15:18
问题 I am using selectize.js. Currently it looks like this: It shows not only words that start with 'arm', but also words (or options) that contain 'arm' as a substring somewhere else. I would like to force the function to show only those words (or options) that start with 'arm'. I checked the usage documentation at https://github.com/selectize/selectize.js/blob/master/docs/usage.md but was not able to figure out how to solve this. Does anybody have any ideas? 回答1: You can use the score property

Shiny server-side updateSelectizeInput does not create selection list

杀马特。学长 韩版系。学妹 提交于 2019-12-12 17:45:29
问题 The following code produces an empty selection box whereas I expected a list of state abbreviation + name pairs. updateSelectizeInput(session, 'selectizer', server=TRUE, label=NULL, choices = cbind(abb=state.abb, name=state.name), options = list(render = I( '{ option: function(item, escape) { return "<div>" + escape(item.abb) + " " + escape(item.name) + "</div>"; } }'), maxItems=3, placeholder='Select a state') ) This code does what I expect: updateSelectizeInput(session, 'basic_selectizer',

selectize.addItem(value) adds the value of the item and not the items label

ε祈祈猫儿з 提交于 2019-12-11 17:35:02
问题 I have found plenty of other questions, but all of their answers have been unable to resolve my issue. I am trying to set the value of a selectize.js input to a specified value. Here is what I am doing: $select = $picker.selectize({ valueField: 'id', labelField: 'displayName', searchField: 'displayName', options: [], create: false, // ... Omitted }); if (initialValue.length > 0) { // Do a search for the user. jQuery.getJSON("/_api/GetUserById?Id=" + initialValue, function(data) { var results