selectize.js

Selectize dropdown width independent of input

断了今生、忘了曾经 提交于 2020-01-02 02:12:24
问题 I am trying to use Selectize to render a dropdown of very long labels. The text can be pretty wide, but the input has a constraint on width. Selectize perfectly wraps the text (in both the input and drop downs) but ideally the drop down would be able to scale wider than the input to allow better readability. Is it possible to get Selectize to have a dropdown width independent of the input? <select style="width:300px" multiple> <option value="">Enter some tags...</option> <option value="1"

Creating an item if not already exists in Selectize.js select box and ajax update the new added item

蹲街弑〆低调 提交于 2019-12-31 19:43:52
问题 I was using Selectize.js in a select box, What i need is, if an item is not in the list of options i would need to add a new item. When new item is added, i want to have an ajax call to update the newly added item to my database. In their documentiation, it says that we can use "create" to have the selectize to add an item. create - Allows the user to create a new items that aren't in the list of options. This option can be any of the following: "true" (default behavior), "false" (disabled),

How can i use an angular js filter to format values in an array

旧城冷巷雨未停 提交于 2019-12-25 17:45:10
问题 I've used angular filters to do all kinds of fun formatting, but always on primitive values. For example, filtering numbers into a currency format. How would I do that same kind of filtering for an array of values? For example price = 1 prices = [1,2,3] Assuming currency is the currency filter mentioned in https://docs.angularjs.org/api/ng/filter/currency {{price | currency}} would return $1.00 I would like {{prices | currency}} to return [$1.00,$2.00,$3.00] how can i write a filter that does

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

强颜欢笑 提交于 2019-12-24 18:23:13
问题 I am using selectizeInput in Shiny and would like to adapt this function so that only words starting with the characters entered by the user in the search field are shown in the option list. I look at the JavaScript code at: force selectize.js only to show options that start with user input and tried the following: library("shiny") selectList <- sapply(1:10000, function(x) paste(sample(letters, 8), collapse = '')) ui <- fluidPage( selectizeInput(inputId = 'mylist', label = 'Select something',

How to install Selectize.js into my Rails app?

。_饼干妹妹 提交于 2019-12-24 11:23:43
问题 I downloaded Selectize.js and I'm trying to install it into my Rails 4 app, but there are so many files and I'm so confused. Can anyone who has successfully installed Selectize into their app help me out with this? I'm trying to achieve an autosuggest input bar into which the user can input no more than 6 items from the database. Here are the contents of my download (version 0.11.0): Sorry about the immense number of documents, but that's exactly why I'm so confused. -brianreavis-selectize.js

selectize.js and Shiny : select choices from a remote API

元气小坏坏 提交于 2019-12-24 09:35:11
问题 With no prior programming knowledge in JavaScript and APIs, I'm having some troubles to make this example fit my needs : select GitHub repo. I'm trying to adapt it to work with this API: https://api-adresse.data.gouv.fr/search/? . The response is a GeoJSON file, where the features are stored in response$features. I want to get the properties$label attribute for each feature. Here is what I've done so far. I get an array but the items are not displayed in the dropdown... UI : ######## # ui.R #

Adding two lists to selectize, the first one should be selected by default

那年仲夏 提交于 2019-12-24 07:06:01
问题 Hi I've a litle problem with selectize, namely how to add two lists and he first one should be selected by default and enduser can select items from second list in same form. Below you can find my code. If I add two times options selectize takes second one only). $(document).ready(function(){ lol = "lol1 , lol2 , lol3" var lol = lol.split(','); var lol = lol.map(function(x) { return { item: x}; }); console.log(lol) console.log(typeof(lol)) wtf = "wtf1 , wtf2 , wtf3" var wtf = wtf.split(',');

Ruby on Rails: Selectize.js with Cocoon

好久不见. 提交于 2019-12-24 06:08:50
问题 I'm trying to make a form in Ruby on Rails to select parts of the construction. New fields (part entries - the joining table) are added by Cocoon gem. Everything works fine but when trying to edit saved constructions Selectize cannot read its current parts' fields. Here is my _part_fields.html.erb: <li class="control-group nested-fields"> <div class="controls"> <%= f.input :quantity %> <%= f.select :part_id, options_from_collection_for_select(Thing.all, :id, :name), {:prompt => "Select or

Ruby on Rails: Selectize.js with Cocoon

二次信任 提交于 2019-12-24 06:07:57
问题 I'm trying to make a form in Ruby on Rails to select parts of the construction. New fields (part entries - the joining table) are added by Cocoon gem. Everything works fine but when trying to edit saved constructions Selectize cannot read its current parts' fields. Here is my _part_fields.html.erb: <li class="control-group nested-fields"> <div class="controls"> <%= f.input :quantity %> <%= f.select :part_id, options_from_collection_for_select(Thing.all, :id, :name), {:prompt => "Select or

Display pre-selected items in angular selectize menu?

我怕爱的太早我们不能终老 提交于 2019-12-24 03:22:42
问题 I have a selectize-ng input in my app: <input type="text" selectize="usersSelect.options" options="users" ng-model="users.selected" /> My controller is $scope.users = []; UsersWithRolesFactory.getUserRoleData().then(function(response) { $scope.users = response; }); $scope.usersSelect = { options: { valueField: 'full_name', labelField: 'full_name', searchField: ['full_name'], plugins: ['remove_button'] } }; My (partial) json data is [{"id":17,"full_name":"Janet Willis","selected":false,