Skip to content

misaka42/CascadeSelect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CascadingSelect

a cascading dropdown list, demo page.

basic usage

CDN

ES6 (lastest) http://unpkg.com/cascading-select/lib/index.js

ES6 (with version) https://unpkg.com/[email protected]/lib/index.js

ES5 https://unpkg.com/[email protected]/lib/index.es5.js

ES5 + uglifyJS http://npm.elemecdn.com/[email protected]/lib/index.es5.js

npm
npm i cascading-select
const CascadingSelect = require('cascading-select')

quick start

const data = [/* data */]

const select = new CascadingSelect({ data }).to(document.body)

select.onChange = arr => { console.log(arr) }

console.log(select.selected)

data struct

run seed.js to generate test data (browser / nodejs)

or directly see demo page , this page will use random data in each visit.

[
  {
    "name": "[group name]",
    "struct": ["[level-0-name]", "[level-1-name]"],
    "data": {
      "0": {
        "0": [{ "i": "[id]", "n": "[name]" }]
      },
      "1": {
        "[parent id]": [{ "i": "[id]", "n": "[name]" }]
      }
    }
  }
]

documention

todo

About

a tiny powerful cascading dropdown list component with pure javascript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published