Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update docs to include preprocessTag method

  • Loading branch information...
commit 5a60877f590a9e170ad905efe0b2062c16426ae5 1 parent 63f7c11
@kevinslin kevinslin authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 README.markdown
View
15 README.markdown
@@ -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.
@@ -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*.
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.