Skip to content

A jquery plugin for having a large list used multiple places on a page without requiring it to exist many times as HTML.

Notifications You must be signed in to change notification settings

danthedeckie/jquery.biglist.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

jquery.biglist.js

Given a 'template' <select> box with hundreds of options, allow many other ` boxes to use the contents instead when they are clicked. For instance, say you have a page with 200 "users", and each of them has as an "emergency contact" select box, a "BFF" select box, and a "arch nemesis" select box, all of which, when clicked, should allow you to select any of the other users If you generate this all as standard HTML, then you're soon going to have staggeringly huge pages. With this plugin, you can have a single "users" selectbox (hidden somewhere), and the contents of that are loaded into each of the other boxes when the user clicks on it. It's intended for use in pages generated by server side code of some sort, but I'm sure you can find other uses for it! example: html: <select id="template"> <option value="banana">Banana!</option> <option value="peach">Peach!</option> <option value="apple">Apple!</option> <option value="durian">Durian!</option> </select> <label>Favourite Fruit: <select class="use_tmpl"><option value="banana">Banana!</option></select></label> <label>Most Smelly Fruit: <select class="use_tmpl"><option value="durian">Durian!</option></select></label> JS: $('select.use_tmpl').biglist('#template'); Licence: MIT. Status: First version, call it beta, alpha, testing, whatever.

About

A jquery plugin for having a large list used multiple places on a page without requiring it to exist many times as HTML.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages