Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnasir committed Nov 1, 2019
1 parent ccfaf41 commit ce5dd2e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A simple and lighweight jQuery plugin for creating cascading dropdowns.
## Installation

```
bower install --save jquery-cascading-dropdown
npm install --save jquery-cascading-dropdown
```

Include script after the jQuery library (unless you are packaging scripts somehow else):
Expand Down Expand Up @@ -227,4 +227,19 @@ $('#dropdown').cascadingDropdown('destroy');

By default, this plugin expects the web service to return a JSON object containing an array of objects with properties 'label' and 'value'. The web service may also include a 'selected' property for an object within an array to indicate that that particular object is to be the selected item.

```json
// Example server response
[
{
"label": "Item 1",
"value": "1"
},
{
"label": "Item 2",
"value": "2",
"selected": true
}
]
```

If the value property is not defined, the dropdown item will set the label as the value, and vice versa.

0 comments on commit ce5dd2e

Please sign in to comment.