{"id":15353750,"url":"https://github.com/westonganger/chosen-remote-source","last_synced_at":"2025-04-15T05:57:08.762Z","repository":{"id":57198312,"uuid":"335141267","full_name":"westonganger/chosen-remote-source","owner":"westonganger","description":"Provides remote data source support for chosen-js selects","archived":false,"fork":false,"pushed_at":"2021-05-20T19:58:36.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T05:57:03.995Z","etag":null,"topics":["ajax","ajax-select","chosen","chosen-js","html-select","javascript","select"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/westonganger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-02-02T02:10:45.000Z","updated_at":"2023-07-17T21:10:49.000Z","dependencies_parsed_at":"2022-09-16T13:12:38.616Z","dependency_job_id":null,"html_url":"https://github.com/westonganger/chosen-remote-source","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westonganger%2Fchosen-remote-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westonganger%2Fchosen-remote-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westonganger%2Fchosen-remote-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westonganger%2Fchosen-remote-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/westonganger","download_url":"https://codeload.github.com/westonganger/chosen-remote-source/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016320,"owners_count":21198832,"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":["ajax","ajax-select","chosen","chosen-js","html-select","javascript","select"],"created_at":"2024-10-01T12:15:06.298Z","updated_at":"2025-04-15T05:57:08.744Z","avatar_url":"https://github.com/westonganger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chosen-remote-source\n\u003ca href=\"https://badge.fury.io/js/chosen-remote-source\" target=\"_blank\"\u003e\u003cimg height=\"21\" style='border:0px;height:21px;' border='0' src=\"https://badge.fury.io/js/chosen-remote-source.svg\" alt=\"NPM Version\"\u003e\u003c/a\u003e\n\u003ca href='https://www.npmjs.org/package/chosen-remote-source' target='_blank'\u003e\u003cimg height='21' style='border:0px;height:21px;' src='https://img.shields.io/npm/dt/chosen-remote-source.svg?label=NPM+Downloads' border='0' alt='NPM Downloads' /\u003e\u003c/a\u003e\n\nProvides remote data source support for [`chosen-js`](https://github.com/harvesthq/chosen) selects.\n\nTo make this library future proof we try not to change or add hardly any code to original chosen-js code.\n\n# Install\n\n#### Yarn or NPM\n```\nyarn add chosen-remote-source\n\nnpm install chosen-remote-source\n```\n\n# Usage\n```javascript\n$('select.chosen-remote-source').chosenRemoteSource({\n  url: \"/my-path\",\n  method: \"GET\",\n  delay: 250,\n  event: 'input',\n  label_field: 'label',\n  value_field: 'value',\n  search_param: 'q',\n  selected_param: 'selected',\n});\n```\n\nNow upon entering text the remote URL will be used to create an AJAX query to update the select options.\n\nThe ajax request will send the following parameter names according to the specified `search_param` and `selected_param` options.\n\n```\n{q: 'foo', selected: [1,6,8]}\n```\n\nThe plugins expects that your URL will return an array of objects with attribute names according to the specified `value_field` and `label_field` options.\n\n```\n[\n  {\n    value: \"1\",\n    label: \"Foo\",\n  },\n\n  {\n    value: \"2\",\n    label: \"Bar\",\n  },\n  \n  /* ... */\n]\n```\n\n# Contributing\n\nTesting is handled within [`./index.html`](./index.html)\n\n# Credits\n\nCreated by [Weston Ganger](https://westonganger.com) - [@westonganger](https://github.com/westonganger)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwestonganger%2Fchosen-remote-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwestonganger%2Fchosen-remote-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwestonganger%2Fchosen-remote-source/lists"}