jquery-tokeninput

jQuery Tokeninput add if not exists

寵の児 提交于 2019-12-03 01:33:49
I am in the process of writing a script that builds upon user input, I have some fields that its values need to be quired from the database, and if no entry found I want to add a new value so the next user will find it through autocomplete. I found this great looking & easy to implement jquery plugin called TokenInput, but it doesn't seem to accept entries that are not available in my database query. Here's the link for the plugin: http://loopj.com/jquery-tokeninput/demo.html Is there a workaround for this ? Or do you suggest another plugin that already has this feature. And I'm a little bit

Jquery Token Input - allowCustomEntry not working

久未见 提交于 2019-12-02 11:00:43
I am using Jquery Token Input version 1.6.0. I would like to be able to enter custom entries into the token-input, but everytime I do so the form submits (I type a custom word and hit enter). Here is my code (in coffeescript): jQuery -> $('[id$=tag_list_tokens]').each -> el = $(this) el.tokenInput '/listings/tags.json', theme: 'facebook' minChars: 1 allowCustomEntry: true preventDuplicates: true prePopulate: el.data('load') allowFreeTagging: false Everything works fine except for the custom entries...any idea what I'm doing wrong? allowFreeTagging wasn't implemented by version 1.6.0. Download

jQuery TokenInput : Tokens are not getting added

丶灬走出姿态 提交于 2019-12-02 05:51:28
问题 I am using jQuery TokenInput which calls the service written in node.js. The service is giving me a response. (I have logged it in onResult and resultsFormatter .) But the drop down of tokens doesn't show up. My service response is as follows: { "data": [ { "name": "a", "key": 1023040, "subtext": "abc" }, { "name": "b", "key": 1023040, "subtext": "pqr" } ] } JavaScript code is as follows. $("#myInputTextBox").tokenInput('http://myWebService', { crossDomain: true, theme: "facebook", minChars:

jQuery TokenInput : Tokens are not getting added

别等时光非礼了梦想. 提交于 2019-12-01 23:26:51
I am using jQuery TokenInput which calls the service written in node.js. The service is giving me a response. (I have logged it in onResult and resultsFormatter .) But the drop down of tokens doesn't show up. My service response is as follows: { "data": [ { "name": "a", "key": 1023040, "subtext": "abc" }, { "name": "b", "key": 1023040, "subtext": "pqr" } ] } JavaScript code is as follows. $("#myInputTextBox").tokenInput('http://myWebService', { crossDomain: true, theme: "facebook", minChars: 3, resultsFormatter: function(item) { console.log("<li><p class='added' data-id='" + item.key + "' data

jQuery Tokeninput with “Combobox” functionality?

懵懂的女人 提交于 2019-12-01 12:17:30
I'm using Loopj Tokeninput plugin and I would like to know if anyone has implemented the jQuery "combobox" functionality in it? or something similar? The scope is to allow for displaying all the data from a local source by clicking an "arrow down" or just by clicking in the input field just like a dropdown menu (but allowing to narrow it down when typing something...). If so, could anyone share how to implement it? Ashirvad Hey there is no method predefined to do that in tokeninput plugin.. However we can alter the plugin itself to achieve what you need. I did some alter to plugin .Do the same

jQuery Token Input (tokenize input) is not working on modal popup, list hidden under popup

孤人 提交于 2019-12-01 03:33:34
I am using a modal popup up control in jQuery, the popup has an input text powered by jQuery Tokenize input plugin. The problem is when i type something on modal popup text box, the search results by tokenize plugin are shown hidden under the popup. Actually they should apprear on top of all controls. Would someone please help me as I am a beginner. Try to seek help from thread below, zindex is not working. https://github.com/loopj/jquery-tokeninput/issues/190 here is the input control that i am using. http://loopj.com/jquery-tokeninput/demo.html Thank you. It works by setting the z-index

Using jquery TokenInput without default 'name'

被刻印的时光 ゝ 提交于 2019-11-30 23:37:46
Im trying to use the jquery tokeninput found here: http://loopj.com/jquery-tokeninput/ Following the guide from railcasts: http://railscasts.com/episodes/258-token-fields By default, it required a 'name' column on the table/json.. Any way to customize to change it to something else (in my case, 'account_number')? (in the reailcast, he says if you dont have a 'name' column, youll require extra customization) The magical lines are <%= f.text_field :author_tokens, "data-pre" => @book.authors.map(&:attributes).to_json %> and format.json { render :json => @authors.map(&:attributes) } These lines

Trouble interacting with Bootstrap modals via Capybara (v2)

对着背影说爱祢 提交于 2019-11-30 17:33:52
In a Rails application I'm trying to test a Bootstrap modal with a jQuery TokenInput field in Rspec using Capybara with the capybara-webkit driver. The portion in question is as follows: click_link 'Create Team Modal' sleep 1 within('div#modal_popup') do fill_in 'input#token-input-team_name', with: 'Fancy team name' sleep 1 fill_in 'input#token-input-team_name', with: '\t' sleep 1 click_button 'Create Team' end page.should have_content('Fancy team name') Click button to get modal Fill in TokenInput with a team name Simulate a Tab key-press to get it selected Create the team Verify the name

Trouble interacting with Bootstrap modals via Capybara (v2)

拥有回忆 提交于 2019-11-30 01:19:13
问题 In a Rails application I'm trying to test a Bootstrap modal with a jQuery TokenInput field in Rspec using Capybara with the capybara-webkit driver. The portion in question is as follows: click_link 'Create Team Modal' sleep 1 within('div#modal_popup') do fill_in 'input#token-input-team_name', with: 'Fancy team name' sleep 1 fill_in 'input#token-input-team_name', with: '\t' sleep 1 click_button 'Create Team' end page.should have_content('Fancy team name') Click button to get modal Fill in

What should be the correct response from web service to display the Jquery token input results?

依然范特西╮ 提交于 2019-11-27 05:42:03
I am using a Jquery Token Input plugin. I have tried to fetch the data from the database instead of local data. My web service returns the json result is wrapped in xml: <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://tempuri.org/">[{"id":"24560","name":"emPOWERed-Admin"},{"id":"24561","name":"emPOWERed-HYD-Visitors"}]</string> I have checked in the site http://loopj.com/jquery-tokeninput/ which says that the script should output JSON search results in the following format: [ {"id":"856","name":"House"}, {"id":"1035","name":"Desperate Housewives"} ] Both seems to be the same,but