{"id":18656764,"url":"https://github.com/optimalbits/gnd-dropdown","last_synced_at":"2025-10-08T23:04:06.573Z","repository":{"id":10237009,"uuid":"12340047","full_name":"OptimalBits/gnd-dropdown","owner":"OptimalBits","description":"A Gnd dropdown component","archived":false,"fork":false,"pushed_at":"2015-02-04T19:40:39.000Z","size":260,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-27T15:05:10.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OptimalBits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-24T07:48:38.000Z","updated_at":"2015-02-04T19:40:39.000Z","dependencies_parsed_at":"2022-08-20T13:30:33.814Z","dependency_job_id":null,"html_url":"https://github.com/OptimalBits/gnd-dropdown","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimalBits%2Fgnd-dropdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimalBits%2Fgnd-dropdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimalBits%2Fgnd-dropdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimalBits%2Fgnd-dropdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OptimalBits","download_url":"https://codeload.github.com/OptimalBits/gnd-dropdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239472124,"owners_count":19644444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:25:13.741Z","updated_at":"2025-10-08T23:04:01.540Z","avatar_url":"https://github.com/OptimalBits.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"gnd-dropdown\n============\n\nA dropdown (as html select) component for Gnd.\n\nIt supports binding a collection to the options and a model to the current\nselection.\n\nInstall\n=======\n\n    npm install gnd-dropdown\n    \n\nUsage\n=====\n\nIn a nodejs server:\n\n    var Dropdrown = require('gnd-dropdown');\n\n    // Dropdown.build points to the directory with the files to server\n    \n    // using connect / express\n    app.use(static(path.join(__dirname, Dropdown.build)))\n    \n  \nIn the client:\n\n    // simple collection\n    var dropdown = new Dropdown(myCollection, {\n      selectedId: mySelectedId,\n      parent: '#dropdown'\n    });\n    dropdown.render();\n    \n    // binding the selected item id to some model property\n    var dropdown = new Dropdown(myCollection, {\n      selection: {model: myModel, key: 'itemId'},\n      parent: '#dropdown'\n    });\n    dropdown.render();\n\n    // Listen to changes\n    dropdown.on('selected:', function(item){\n      console.log(item);\n    });\n    \n    // Do something special when last element is deleted\n    dropdown.on('lastRemoved:', function(item){\n      // ---\n    })\n  \n\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimalbits%2Fgnd-dropdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptimalbits%2Fgnd-dropdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimalbits%2Fgnd-dropdown/lists"}