Skip to content

Commit

Permalink
Merge pull request aehlke#154 from kevinslin/master
Browse files Browse the repository at this point in the history
Update docs to include preprocessTag function
  • Loading branch information
aehlke committed Mar 5, 2013
2 parents 63f7c11 + 5a60877 commit e5b0210
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Defaults to an empty array *[]*.
### autocomplete (Object)

Allows overriding the `source` and `select` options that are set by default,
as well as adding any other options you want to pass to the jQuery UI Autocomplete widget, such as `minLength` or `delay`.
as well as adding any other options you want to pass to the jQuery UI Autocomplete widget, such as `minLength` or `delay`.

The `autocomplete.source` should be overridden if you want to use custom autocompletion sources, like an Ajax / XHR response.

Expand Down Expand Up @@ -134,7 +134,7 @@ Defaults to *false*.
### tagLimit (integer)

Limits the total number of tags that can be entered at once. Note that if you use this option with preloaded data,
it may truncate the number of preloaded tags. Set to `null` for unlimited tags. See the **onTagLimitExceeded**
it may truncate the number of preloaded tags. Set to `null` for unlimited tags. See the **onTagLimitExceeded**
callback for customizing this behavior.

Defaults to *null*.
Expand Down Expand Up @@ -253,6 +253,17 @@ Adds new tag to the list. The `additionalClass` parameter is an optional way to

$("#myTags").tagit("createTag", "brand-new-tag");

### preprocessTag(function, Callback)
Set a function to be called before tag is created. Callback receives the
value of the tag created.

// ensure all tags are capitalized
$(#tag-it").tagit("preprocessTag", function(val) {
if (!val) { return ''; }
return val[0].toUpperCase() + val.slice(1, val.length);
});
// foo -> Foo

### removeTagByLabel(tagLabel, animate)
Finds the tag with the label `tagLabel` and removes it. If no such tag is found, it'll throw an exception.

Expand Down

0 comments on commit e5b0210

Please sign in to comment.