Skip to content

Commit

Permalink
[doc] Added a prototype with options and events
Browse files Browse the repository at this point in the history
  • Loading branch information
COil committed Feb 5, 2013
1 parent 2c65818 commit 2ef48fe
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,52 @@ The function receives the click event and an objecting containing `tag` and `tag
Called when attempting to create a tag while the tag limit has already been reached. Receives a null event,
and an object with the property `duringInitialization`. This can only be called if **tagLimit** is set.

## Prototype

Here is an example with all the default options and events:

$("#myTags").tagit({

// Options
fieldName: "skills",
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"],
autocomplete: {delay: 0, minLength: 2},
showAutocompleteOnFocus: false,
removeConfirmation: false,
caseSensitive: true,
allowDuplicates: false,
allowSpaces: false,
readOnly: false,
tagLimit: null,
singleField: false,
singleFieldDelimiter: ',',
singleFieldNode: null,
tabIndex: null,
placeholderText: null,

// Events
beforeTagAdded: function(event, ui) {
console.log(ui.tag);
},
afterTagAdded: function(event, ui) {
console.log(ui.tag);
},
beforeTagRemoved: function(event, ui) {
console.log(ui.tag);
},
onTagExists: function(event, ui) {
console.log(ui.tag);
},
onTagClicked: function(event, ui) {
console.log(ui.tag);
},
onTagLimitExceeded: function(event, ui) {
console.log(ui.tag);
}

});


## Methods

### assignedTags()
Expand All @@ -263,7 +309,6 @@ Clears the widget of all tags — removes each tag it contains, so the **beforeT

$("#myTags").tagit("removeAll");


## Properties

### tagInput
Expand Down

0 comments on commit 2ef48fe

Please sign in to comment.