tag-it

How to use tag-it

独自空忆成欢 提交于 2019-12-11 03:25:15
问题 I am using tagit library from here I created the tagit which working correctly and i created the array as follows: $("#name).tagit({ itemName: "teamId", fieldName: "teamName", availableTags: array, allowSpaces:true, caseSensitive:false, removeConfirmation:true, placeholderText:"Tag Group..." }); var a =["1","2","3","4"]; while using the tag-it all options can be selected correctly ....I want that the tag "4" has to appear as default selection before choosing any option how can i do this..

Tag-it onlyAvalaibleTags option doesn't work

时光毁灭记忆、已成空白 提交于 2019-12-07 12:59:54
问题 I use tag-it plugin from https://github.com/aehlke/tag-it/downloads. How to disable adding new tags? $(document).ready(function () { $("#Tags").tagit({ singleField: true, singleFieldNode: $('#mySingleField'), // onlyAvailableTags : true, allowNewTags: false, tagSource: [@Html.Raw(ViewBag.AvailableTags)] }); }); I tried to use onlyAvailableTags : true and allowNewTags: false options, but there's no effect. 回答1: Since you say "but there's no effect", I would guess that @Html.Raw(ViewBag

Modify the behavior of jquery tag-it based on autocomplete library to use ajax JSON sources

人盡茶涼 提交于 2019-12-06 06:14:09
问题 I'm trying to add some functionality to jQuery plugin tag-it based on auto-complete : a) I try to filtering my JSON data to display only name of tag. A JSON sample returned by /repo/json : [{id:1, name:"0.8-alpha-1", category:"version"}, {id:2, name:"0.8-alpha-2", category:"version"}, {id:3, name:"0.8-alpha-3", category:"version"}, {id:4, name:"0.8-alpha-4", category:"version"}, {id:5, name:"0.8-alpha-1", category:"version"}, {id:6, name:"0.8-alpha-2", category:"version"}, {id:7, name:"0.8

Tag-it onlyAvalaibleTags option doesn't work

妖精的绣舞 提交于 2019-12-05 22:08:57
I use tag-it plugin from https://github.com/aehlke/tag-it/downloads . How to disable adding new tags? $(document).ready(function () { $("#Tags").tagit({ singleField: true, singleFieldNode: $('#mySingleField'), // onlyAvailableTags : true, allowNewTags: false, tagSource: [@Html.Raw(ViewBag.AvailableTags)] }); }); I tried to use onlyAvailableTags : true and allowNewTags: false options, but there's no effect. Since you say "but there's no effect", I would guess that @Html.Raw(ViewBag.AvailableTags) produces an output that that breaks the javascript syntax. The tags need to be in quotes, otherwise

Using jquery tagit plugin, Is there anyway to disable all entry?

为君一笑 提交于 2019-12-05 16:32:04
I have a page and i am using jquery tagit plugin which works great but i am trying to disable it when i click on a button, and have it have similar behavior to when i disable a select Dropdown like this: $("#selectDropdown").val(0); $('#selectDropdown').prop('disabled', 'disabled'); Is there anyway to disable and enable the jquery tagit Plugin programatically. I see there is a readonly option on the docs page so I tried doing something like this: $("#locationTags").tagit({ "readOnly": false }); but that doesn't seem to do anything. Any suggestions? The following demonstrates how you could

Modify the behavior of jquery tag-it based on autocomplete library to use ajax JSON sources

我怕爱的太早我们不能终老 提交于 2019-12-04 11:16:48
I'm trying to add some functionality to jQuery plugin tag-it based on auto-complete : a) I try to filtering my JSON data to display only name of tag. A JSON sample returned by /repo/json : [{id:1, name:"0.8-alpha-1", category:"version"}, {id:2, name:"0.8-alpha-2", category:"version"}, {id:3, name:"0.8-alpha-3", category:"version"}, {id:4, name:"0.8-alpha-4", category:"version"}, {id:5, name:"0.8-alpha-1", category:"version"}, {id:6, name:"0.8-alpha-2", category:"version"}, {id:7, name:"0.8-alpha-3", category:"version"}, {id:8, name:"0.8-alpha-4", category:"version"}] b) I want to submit the id

jQuery Tag-It - using a value and label object list

守給你的承諾、 提交于 2019-12-03 07:18:42
问题 Just tried the excellent Tag-It! plug-in for jquery (http://aehlke.github.com/tag-it/), but I can't get it to work how I would like. I have an object list like this: var food = [{value:1,label:'Pizza'},{value:2,label:'Burger'},{value:3,label:'Salad'}]; Which I pass to the tagSource option in my setup: $("#my_food_tags").tagit({ tagSource: food, singleField: true, singleFieldNode: $("#my_food"), placeholderText: "Start typing a food name" }); This works fine, except when I click the auto

Serializing and unserializing an array in javascript

一曲冷凌霜 提交于 2019-12-02 22:13:00
I'm using the tag-it library for jquery to make a tagging system (a bit like the stackoverflow one). After the user types his tags the library returns a javascript array that I want to save in a MySQL database. I didn't find a serialize and unserialize function in javascript. Before coding my own function I'd like to make sure I'm not reinventing the wheel here. It seems crazy that there is no native way to save an array to a database and then use it again. tl;dr => how can I save a javascript array in a MySQL database to reuse it later ? You can use JSON.stringify() ( MDN docu ) and JSON

jQuery Tag-It - using a value and label object list

谁都会走 提交于 2019-12-02 20:51:30
Just tried the excellent Tag-It! plug-in for jquery ( http://aehlke.github.com/tag-it/ ), but I can't get it to work how I would like. I have an object list like this: var food = [{value:1,label:'Pizza'},{value:2,label:'Burger'},{value:3,label:'Salad'}]; Which I pass to the tagSource option in my setup: $("#my_food_tags").tagit({ tagSource: food, singleField: true, singleFieldNode: $("#my_food"), placeholderText: "Start typing a food name" }); This works fine, except when I click the auto-complete list item, it displays the numeric value in the tag, rather than the food name. Therefore, it is

How we can get the ID of selected tags using Jquery tagit?

两盒软妹~` 提交于 2019-11-29 11:19:56
I have a input tag field ,and I want to get the ID of the selected tages So I have try http://jsfiddle.net/u8zj5/19/ But my problem I want to get the id not label or value to pass into id="show" but I failed. <input type="text" id="field1" name="field1" value=""/> <span id="show">show ID here</span> jQuery(document).ready(function(){ var availableTags = [{"id":"144","label":"Allicelabel","value":"Allice value"}]; jQuery("input#field1").each(function(){ var target = jQuery(this); var currenttags = target.val(); target.hide() .after("<ul class=\"tags\"><li>"+currenttags+"</li></ul>"); var