Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirabyan authored Jul 18, 2016
1 parent 1fbe9fd commit e5aabcc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,23 @@ var data = [
$('textarea').mentionsInput({source: data});
```

Remote datasource (ajax):
##### Remote datasource (ajax):

```
$('textarea').mentionsInput({source: 'http://example.com/users.json'})
```
The url is given a query paremeter `term`, like `http://example.com/users.json?term=Foo` and must return a json list of matched values (like the above).

Calling a method:
You can also provide custom function to `source` argument, for more info take a look at [jQuery Autocomplete docs](http://api.jqueryui.com/autocomplete/#option-source).


##### Calling a method:
```
$('textarea').mentionsInput('getValue');
$('textarea').mentionsInput('setValue', 'Hello, @[Alex](user:1)');
```

Getting value:
##### Getting value:
`$('textarea').mentionsInput('getValue')` -> `Hello, @[Alex](user:1)`
`$('textarea').mentionsInput('getRawValue')` -> `Hello, Alex`

Expand Down

0 comments on commit e5aabcc

Please sign in to comment.