-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi *, I am new to this list, so please excuse me if this has been covered before (unfortunately the search function at http://www.ruby-forum.com/forum/10 is disabled at the moment). If yes, then a pointer to a solution would be great. I want to create a sortable tree with scriptaculous Sortable. There are several categories and subcatgories: cat_a - --subcat_a_1 - --subcat_a_2 cat_b - --subcat_b_1 cat_c cat_d - --subcat_d_1 and so on, you get the point. Now I want to sort subcategories inside a category and move them from e.g. cat_a to cat_d and I also want to sort the main category order itself (e.g. moving cat_c to the top of the list). Both the categories and the subcategories are ul''s. My containment parameter for the Sortable.create now contains _all_ id''s but I can only move the categories, not the subcategories. Is it possible to achieve this with the Sortable class at all? Do I do something wrong? Did I misunderstand the whole thing? Thanks in advance. Frank - -- "Laut einer Studie der deutschen Ärztevereinigung sterben immer mehr Rentner vor dem Computer. Sie drücken versehentlich die Tastenkombination Alt+Entfernen." http://www.landseer-stuttgart.de http://www.pn-cms.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBYrK4U8nM9OV6z8RAu3uAKDZaZnSI6W6syFAA2A6Lx4N2DMA3QCeNt5J Kz+4rwSA8k62LnBiSHeoKPs=0NgW -----END PGP SIGNATURE-----
Hello, and welcome ! Please have a look at this : http://www.oriontransfer.co.nz/Sortable%20List%20v2.zip Does it feeds your needs ? On 3/1/06, Frank Schummertz <frank.schummertz-wuHXZRSNxgaBAmxm6OvjtTjhTm2NLCe8@public.gmane.org> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi *, > > I am new to this list, so please excuse me if this has been covered > before (unfortunately the search function at > http://www.ruby-forum.com/forum/10 is disabled at the moment). > If yes, then a pointer to a solution would be great. > > I want to create a sortable tree with scriptaculous Sortable. There are > several categories and subcatgories: > > cat_a > - --subcat_a_1 > - --subcat_a_2 > cat_b > - --subcat_b_1 > cat_c > cat_d > - --subcat_d_1 > > and so on, you get the point. > > Now I want to sort subcategories inside a category and move them from > e.g. cat_a to cat_d and I also want to sort the main category order > itself (e.g. moving cat_c to the top of the list). > > Both the categories and the subcategories are ul''s. My containment > parameter for the Sortable.create now contains _all_ id''s but I can > only move the categories, not the subcategories. > > Is it possible to achieve this with the Sortable class at all? > Do I do something wrong? > Did I misunderstand the whole thing? > > Thanks in advance. > > Frank > > > - -- > "Laut einer Studie der deutschen Ärztevereinigung sterben immer > mehr Rentner vor dem Computer. Sie drücken versehentlich die > Tastenkombination Alt+Entfernen." > > http://www.landseer-stuttgart.de > http://www.pn-cms.de > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.5 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEBYrK4U8nM9OV6z8RAu3uAKDZaZnSI6W6syFAA2A6Lx4N2DMA3QCeNt5J > Kz+4rwSA8k62LnBiSHeoKPs> =0NgW > -----END PGP SIGNATURE----- > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nicolas Terray wrote:> Please have a look at this : > http://www.oriontransfer.co.nz/Sortable%20List%20v2.zip > Does it feeds your needs ?Yes, it works, thanks for the link (I did hope that I wasn''t the only one with this problem...) It even works too good - my categories/subcategories do not change their levels. I have a two-level tree only at the moment (ok, its not really a tree, but this might change in the future). Can I avoid this behaviour? And it seems that I have to change prototype.js and scriptaculous files too which I would like to avoid if possible. Is there chance to get this incorporated in both libs as standard functionality? Frank - -- "Laut einer Studie der deutschen Ärztevereinigung sterben immer mehr Rentner vor dem Computer. Sie drücken versehentlich die Tastenkombination Alt+Entfernen." http://www.landseer-stuttgart.de http://www.pn-cms.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBZTA4U8nM9OV6z8RAvfhAJ9gvV3p/FFA34gqWYhNTGORplw3MQCeLpsR OxGzmhxFPxSpXEBGXSufWRU=Piut -----END PGP SIGNATURE-----
On 3/1/06, Frank Schummertz <frank.schummertz-wuHXZRSNxgaBAmxm6OvjtTjhTm2NLCe8@public.gmane.org> wrote:> And it seems that I have to change prototype.js and scriptaculous files > too which I would like to avoid if possible. > > Is there chance to get this incorporated in both libs as standard > functionality? >There was a little debate on this point last month. The start is here : http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-February/subject.html#2632
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nicolas Terray wrote:> There was a little debate on this point last month. The start is here : > http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-February/subject.html#2632Besides the fact that 50% of the discussion is about text indenting :-) I found out that the only file that really needs to be changed is dragdrop.js. First tests with the supplied test.html seem to prove this. I replaced prototype.js and effect.js with the original files and the sorting still works. In my project I will try to overload the original dragdrop.js with the updated version when I need to sort the tree. Sammi did a real good job here and I hope Thomas will consider incorporating this patch into the next release. Now the last remaining problem for me is the moving of elements across the whole tree. Is it possible to get rid of this? Frank - -- "Laut einer Studie der deutschen Ärztevereinigung sterben immer mehr Rentner vor dem Computer. Sie drücken versehentlich die Tastenkombination Alt+Entfernen." http://www.landseer-stuttgart.de http://www.pn-cms.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBaBe4U8nM9OV6z8RAqpiAJ9vKe277NlZ/GVHWxH07mDXsUclMQCgywTD 9G25xQs5ZpiWtX9acD7N9Ho=r5fX -----END PGP SIGNATURE-----
Definitely. I just have to "secure" some time for some reviewing ''n'' stuff. So, please be patient with me. :) -Thomas Am 01.03.2006 um 14:23 schrieb Frank Schummertz:> > Sammi did a real good job here and I hope Thomas will consider > incorporating this patch into the next release.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thomas Fuchs wrote:> I just have to "secure" some time for some reviewing ''n'' stuff. > So, please be patient with me. :)No problem :-) As long as I know that it will be integrated (maybe even with a solution for my problem as well) I can start using the new dragdrop.js here and now. Thanks for the good news. Frank - -- "Laut einer Studie der deutschen Ärztevereinigung sterben immer mehr Rentner vor dem Computer. Sie drücken versehentlich die Tastenkombination Alt+Entfernen." http://www.landseer-stuttgart.de http://www.pn-cms.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBag54U8nM9OV6z8RAspdAJ9hrKwsdfWwNwHJ5X1guJgDxSCksgCgooMW jP5MZUVDM7Kgor4HLsnXSO4=fqSu -----END PGP SIGNATURE-----
On 3/1/06, Frank Schummertz <frank.schummertz-wuHXZRSNxgaBAmxm6OvjtTjhTm2NLCe8@public.gmane.org> wrote:> It even works too good - my categories/subcategories do not change their > levels. I have a two-level tree only at the moment (ok, its not really a > tree, but this might change in the future). Can I avoid this behaviour? >With an unmodified version(1.5.3) of scriptaculous (i.e. without the link provided before) I''ve just made this : --8<------------ <script type="text/javascript" src="/scripts/prototype/prototype.js"></script> <script type="text/javascript" src="/scripts/scriptaculous/scriptaculous.js"></script> <ul id="cats"> <li> <div>Cat A</div> <ul id="cat_a" style="min-height:1px;"> <li>A_1</li> <li>A_2</li> </ul> </li> <li> <div>Cat B</div> <ul id="cat_b" style="min-height:1px;"> </ul> </li> <li> <div>Cat C</div> <ul id="cat_c" style="min-height:1px;"> <li>C_1</li> </ul> </li> </ul> <script type=''text/javascript''> Sortable.create("cat_a", {dropOnEmpty:true,containment:["cat_a","cat_b","cat_c"]}); Sortable.create("cat_b", {dropOnEmpty:true,containment:["cat_a","cat_b","cat_c"]}); Sortable.create("cat_c", {dropOnEmpty:true,containment:["cat_a","cat_b","cat_c"]}); Sortable.create("cats"); </script> --8<------------ Is this the behaviour you want ?
On 3/1/06, Nicolas Terray <nicolas.terray-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> With an unmodified version(1.5.3) of scriptaculous (i.e. without the > link provided before) I''ve just made this : > --8<------------[snip]> --8<------------ > Is this the behaviour you want ? >Of course :(, it doesn''t work well ''as is'' on IE
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nicolas Terray wrote:> Is this the behaviour you want ?YES! Thats it... thanks a lot, Nicolas. And if you don''t need the list bullets (I won''t...), this works even in IE (sigh...): - ------snip------ <html> <head> <style type="text/css"> ul { list-style-type: none; padding: 2px; margin: 2px; } li { padding: 2px; margin: 2px; min-height: 1px; } </style> <script type="text/javascript" src="modules/pnForum/pnjavascript/prototype.js"></script> <script type="text/javascript" src="modules/pnForum/pnjavascript/scriptaculous.js"></script> </head> <body> <ul id="cats"> <li> <div>Cat A</div> <ul id="cat_a"> <li>A_1</li> <li>A_2</li> </ul> </li> <li> <div>Cat B</div> <ul id="cat_b"> </ul> </li> <li> <div>Cat C</div> <ul id="cat_c"> <li>C_1</li> </ul> </li> </ul> <script type=''text/javascript''> Sortable.create("cat_a", {dropOnEmpty:true, containment:["cat_a","cat_b","cat_c"], constraint: false}); Sortable.create("cat_b", {dropOnEmpty:true, containment:["cat_a","cat_b","cat_c"], constraint: false}); Sortable.create("cat_c", {dropOnEmpty:true, containment:["cat_a","cat_b","cat_c"], constraint: false}); Sortable.create("cats"); </script> </body> </html> - ------snap------ - -- "Laut einer Studie der deutschen Ärztevereinigung sterben immer mehr Rentner vor dem Computer. Sie drücken versehentlich die Tastenkombination Alt+Entfernen." http://www.landseer-stuttgart.de http://www.pn-cms.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBbEu4U8nM9OV6z8RAo76AKCog2cRqQytfO8GPNpLehbQ+RIzuQCfUEo6 FmwuNdseAi38453PGCzTksM=6XOo -----END PGP SIGNATURE-----