Next: ability to add nodes to the selected list #75

wants to merge 28 commits into


None yet

2 participants


When populating from a database, it may be the case that there are some pre-selected nodes; I'd like to be able to add these to the selected list.

I've added an argument to addOptions, to that end, `selected': that sets selected="selected" on the options; so that they get added to selectedList instead of availableList later on.

Yanick Rochon and others added some commits May 17, 2009
Yanick Rochon Updated page notice 3aef323
Yanick Rochon Fixed typo 5204181
Yanick Rochon Merge branch 'master' into gh-pages 997c987
Yanick Rochon Updates and optimizations 354b60d
Yanick Rochon Speed improvements + CSS cleanup : not fully tested yet 5c62013
Yanick Rochon removed temp file b1e786c
Yanick Rochon Fail nicely if themeroller is not availe (no network) + CSS fix for l…
…ist actions + async task with busy message for ui feedback
Yanick Rochon Redesigned the sortable in favor of draggable/droppable with autosort…
…ing if enabled (if option sorted is false, perhaps have the sortable re-inserted) + redesigned the cache system and bash operations + CSS cleanup and fully integrated theme roller for the list containers + added spanish translation (thanks hkadejo) did also renamed the translation files to reflect ui.multiselect file naming + input field now autosize to best fit depending on language selection + etc.
Yanick Rochon Fixed batch node insertion bug (further tests needed) + implemented r…
…emote node insertion with simple text lists + added another animation effect on node transfer + better management of batch process
Yanick Rochon Fixed some bugs (mainly with IE... again) + fixed height problem when…
… more than 1 multiselect present on same page + code cleanup (unused and debug vars) + added some todos
Yanick Rochon Added templates for localization + fixed input focus bug in webkit + …
…relocated the branch homepage so the PHP would actually work
Yanick Rochon Added some getters and setters + added some input fields to the demo …
…page + added a new dependancy (blockUI). The code has grown in size, but has proven to be stable, even with a public API
Yanick Rochon Added public API through getters and setters + added new dependancy (…
…blockUI) + updated the demo page to control the widget externally.

The code has grown, but proven to be stable, and relatively fast.
Yanick Rochon Changed some config behavior: sortable and droppable
The nodeComparator is used on both list only if a callback is provided (there is no type check, so it's either boolean | Function -- should there be a setting to use the comparator on the selected/available/both items only?)
Incremented to 0.4.32-y (because I wanted to)
The sortable/droppable works as is, but implementation both way needs to be fixed.
Yanick Rochon Implemented drag'n'drop mixing droppable and sortable (can be buggy).
Code needs to be cleaned a little...
TODO : reorder <option> elements according to sortable selected order
Yanick Rochon The options are reordering (need mroe tests)
There is a weird bug with IE (as usual) where dropped elements fly down the page before the item appears in the list...
The code needs to be cleaned, and improved, but it's a start.

	modified:   index.html
	modified:   js/ui.multiselect.js
	modified:   version.txt
Yanick Rochon Added a new plugin ($.tmpl) instead of overloading the String prototy…
…pe (corss-library compatibility)

Modified the localisation strings to work with $.tmpl
Added getters/setters + added a new error message (option readonly)
Modified the demo page to display API and make it more dynamic (fixed some links also)
Added some styles (needs to be cleaned)
Added form.php to catch form actions and return feedback
Yanick Rochon Rewritten the drag and drop handlers, but they are still unstable wit…
…h "sortable:both" (best use with default options, or limiting to droppables, or none)

Some speed improvements, although deselecting items is slowing than selecting...
Added events: "messages" to handle errors, "selected" to handle selected items and "deselected" when they are deselected.
Tweaked the demo page a little.

- the search command still searches for option values, while I consider more and more making it use the option text instead and having something else to find an option text from it's key (perhaps: .multiselect('option', 'find', key) ?)
Yanick Rochon Sortables and droppables fully working, with option sorting sync. + M…
…odified the demo page to reflect latest development and added the version info and license info. Widget is almost ready for 1.0 state!
Yanick Rochon Forgot to reset default options to sortable ('left') 9ca1dff
michael merged with yanick's super-advanced version 0.5 ;-) eb41142
michael added readme 106b40d
Yanick Rochon Added the GPL-LICENSE.txt file on the demo site. + Little improvement…
… (?) on the demo page API section. + Fixed a flaw in the _setBusy function. + Drag and drop may still happen on busy state, and it may become a bug... however it is not for the moment. + Little improvement in the selectedValue public method.
Yanick Rochon Removed DEBUG state... 483aaeb
michael merged with 0.51-y bab17f2
michael now works along with jQuery 1.4.2 and jQuery UI 1.8 5be34d2
michael forgot to pull first — this completes the jQuery UI 1.8 patch. 28c94cc
@klutometis klutometis ability to add nodes to the selected list bf3deae

How do I implement this addOptions. I have a jquery dialog window that opens up a add options form the from AJAX posts the new options into the database then I want to add these new options to the select. I can do this on a normal select $('#options').append(new Option('Foo', 'foo', true, true));.

How do I do this with this jquery multiselect widget?

Many Thanks in advance for anyone that take the time to hold my hand on this.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment