Hi, I found it a while ago, an add-on to Rails for supporting movable select boxes, but I searched through the wiki and the mailing list and couldnt find what I was looking for. I was hoping someone might know of or remember something about the project. Thanks, Dylan.
> I found it a while ago, an add-on to Rails for supporting movable > select boxes, but I searched through the wiki and the mailing list > and couldnt find what I was looking for. I was hoping someone might > know of or remember something about the project.What''s a movable select box? Do you mean multiple select box? If so, there is an example of the latter from typo''s admin interface: Article Form Partial: http://typo.leetsoft.com/trac/file/trunk/app/ views/admin/content/_form.rhtml ... <select id="categories" name="categories[]" multiple="multiple" size="10" style="width:250px;"> <%= options_from_collection_for_select(@categories, "id", "name", @selected) %> </select> ... Article controller: http://typo.leetsoft.com/trac/file/trunk/app/ controllers/admin/content_controller.rb ... def edit @article = Article.find(params[:id]) @article.attributes = params[:article] @categories = Category.find_all @selected = @article.categories.collect { |cat| cat.id.to_i } if request.post? @article.categories.clear @article.categories << Category.find(params[:categories]) if params[:categories] if @article.save flash[:notice] = ''Article was successfully updated.'' redirect_to :action => ''show'', :id => @article.id end end end ... The only problem with this implementation is that when editing an article, it''s too easy to click on another category and accidently deselect all the others. I decided to use checkboxes instead of multiple selects for my projects but I use the same controller code ti clear and re-link the habtm object. / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / R O B E R T B O U S Q U E T Principle Web Designer/Developer Debut Web Design, Los Angeles robert-GwistbuOWD+ovDFt+AQlJdBPR1lH4CV8@public.gmane.org http://debutwebdesign.com 213.840.7212 p 530.579.3208 f _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi Robert, A movable select list/box is when there are two lists and you move options between them. http://www.mattkruse.com/javascript/optiontransfer/ Dylan.
On Monday 08 August 2005 02:33, Dylan Egan wrote:> Hi Robert, > > A movable select list/box is when there are two lists and you move > options between them. > > http://www.mattkruse.com/javascript/optiontransfer/How about this: http://www.schuerig.de/michael/boilerplate/#habtm BoilerPlate is constantly evolving, but I don''t find the time to package everything nicely. The available version is pretty outdated by now. Michael -- Michael Schuerig The Fifth Rider of the Apocalypse mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org is a programmer. http://www.schuerig.de/michael/
Hi Michael, That was the package I was looking for. I kept on thinking of some other name. Thanks for that. Is is possible to just rip out the multiple object chooser method and use it by itself? Also how well does the multiple object chooser work in IE? As you said it is evolving but not being packaged up to date is it possible to get access to the latest? Is there a CVS or SVN repository about? Dylan.> >How about this: > >http://www.schuerig.de/michael/boilerplate/#habtm > >BoilerPlate is constantly evolving, but I don''t find the time to package >everything nicely. The available version is pretty outdated by now. > >Michael > > >
On Monday 08 August 2005 03:11, Dylan Egan wrote:> >http://www.schuerig.de/michael/boilerplate/#habtm> That was the package I was looking for. I kept on thinking of some > other name. > > Thanks for that. Is is possible to just rip out the multiple object > chooser method and use it by itself?Ripping it out would be to much work. I''m creating the entire chooser with a helper method which in turn depends on lower levels. If the chooser is really all you want then its dependencies are probably too heavy. But if you''re willing to create the HTML by hand, then, although it''s a bit of work, it is not complicated. For moving around options between select boxes, you can use the Form.Select... functions from http://www.schuerig.de/michael/javascript/protoplus.js (requires http://www.schuerig.de/michael/javascript/stdext.js)> Also how well does the multiple object chooser work in IE?I haven''t tested yet, but as I need it on IE soon, I''ll have to make sure it works. The JavaScript is not complicated or in any way unusual, thus I expect it to work> As you said it is evolving but not being packaged up to date is it > possible to get access to the latest? Is there a CVS or SVN > repository about?No, sorry, I don''t have a public repository. Another important thing that keeps me from a release is that I''m using rails from SVN HEAD with a couple of my own patches, of which I hope that they make it into rails (hint! hint!) or that I at least hear about them. Releasing a package that does not work with any released version of rails would be rather pointless (and probably a support headhache for me). Michael -- Michael Schuerig Life is just as deadly mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org As it looks http://www.schuerig.de/michael/ --Richard Thompson, Sibella
Hi,> >Ripping it out would be to much work. I''m creating the entire chooser >with a helper method which in turn depends on lower levels. If the >chooser is really all you want then its dependencies are probably too >heavy. But if you''re willing to create the HTML by hand, then, although >it''s a bit of work, it is not complicated. For moving around options >between select boxes, you can use the Form.Select... functions from > >http://www.schuerig.de/michael/javascript/protoplus.js >(requires http://www.schuerig.de/michael/javascript/stdext.js) >I don''t mind writing the HTML by hand, but I have a lot of parts of the site that require it and it would be tedious to continuously doing it. I might just try putting together my own helper method for creating such select lists.>I haven''t tested yet, but as I need it on IE soon, I''ll have to make >sure it works. The JavaScript is not complicated or in any way unusual, >thus I expect it to work > >Yeah, client uses IE and don''t want them to always call me when they want to move something about.>No, sorry, I don''t have a public repository. Another important thing >that keeps me from a release is that I''m using rails from SVN HEAD with >a couple of my own patches, of which I hope that they make it into >rails (hint! hint!) or that I at least hear about them. Releasing a >package that does not work with any released version of rails would be >rather pointless (and probably a support headhache for me). > >Yeah I hope atleast it does get included into Rails one day as it is mighty useful. Dylan.
On Monday 08 August 2005 11:28, Dylan Egan wrote:> I don''t mind writing the HTML by hand, but I have a lot of parts of > the site that require it and it would be tedious to continuously > doing it. I might just try putting together my own helper method for > creating such select lists.Dylan, if you like, I can send you my current working version with patched rails included. The tar.gz is about 2.5MB. Michael -- Michael Schuerig I am the sum total of the parts mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org I control directly. http://www.schuerig.de/michael/ --Daniel C. Dennett, Elbow Room
Michael, If you could that''d be great. Dylan.> >Dylan, > >if you like, I can send you my current working version with patched >rails included. The tar.gz is about 2.5MB. > >Michael > > >
Dylan Egan wrote:> Hi, > >> >> Ripping it out would be to much work. I''m creating the entire chooser >> with a helper method which in turn depends on lower levels. If the >> chooser is really all you want then its dependencies are probably too >> heavy. But if you''re willing to create the HTML by hand, then, >> although it''s a bit of work, it is not complicated. For moving around >> options between select boxes, you can use the Form.Select... >> functions from >> >> http://www.schuerig.de/michael/javascript/protoplus.js >> (requires http://www.schuerig.de/michael/javascript/stdext.js) >> > I don''t mind writing the HTML by hand, but I have a lot of parts of > the site that require it and it would be tedious to continuously doing > it. I might just try putting together my own helper method for > creating such select lists.Do you mean something like this? http://livsey.org/experiments/multiselect/ Rewrites the DOM of the page etc to give a 2 panel multiselect box. (blurb from the page) * Automatically populates the left/right columns with selected items on page load * Move one, many, all items at a time * Supports double clicking to move an item to the other side * Degrades gracefully without JS. Just get a standard multiselect box * Completely customisable through CSS. I''m in the process of rewriting it to make the code nicer, but it works well and is in use in many projects. -- R.Livsey http://livsey.org
hi,> If you could that''d be great.please send it over here, too! -- bye, TOM
Hi Richard, I had previously posted an example of what I was referring too, but your work is much better than that. Especially with the fallback option. Dylan.> > > Do you mean something like this? > http://livsey.org/experiments/multiselect/ > > Rewrites the DOM of the page etc to give a 2 panel multiselect box. > > (blurb from the page) > * Automatically populates the left/right columns with selected > items on page load > * Move one, many, all items at a time > * Supports double clicking to move an item to the other side > * Degrades gracefully without JS. Just get a standard multiselect box > * Completely customisable through CSS. > > I''m in the process of rewriting it to make the code nicer, but it > works well and is in use in many projects. >