|
»
»
»
Sortable nested elements
|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Sortable nested elementsCan sortable handle nested elements? I have a flatplan app for a magazine - I want to be able to move pages onto spreads, and move spreads around the flatplan. So a user could move say page 2 from the first spread onto the 2nd spread, and move the whole of the second spread to be the, say, 15th spread - and so on. Obviously I will need to build some logic that only allows two pages per spread (printers are so demanding that way) but having used UI elsewhere am keen to re-use if pos. I am also looking at jTree to do this - but would prefer to re-use UI if pos. Is it pos? And any pointers hugely appreciated - virtual pints of ale all round. Many thanks Ben (this is the sort of thing I had in mind ...) <ol> <li id="spread_1"> <ol> <li id="page_1"><img src=" jpeg of p1" /></li> <li id="page_2"><img src=" jpeg of p2" /></li> </ol> </li> <li id="spread_2"> <ol> <li id="page_3"><img src=" jpeg of p3" /></li> <li id="page_4"><img src=" jpeg of p4" /></li> </ol> </li> .... </ol> Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsHa, I asked this exact question a couple of days ago and the answer was "yes" from Paul, the lead UI developer. I've not actually tried it yet though. -- Josh ----- Original Message ----- From: "BenR" <ben.rooney@...> To: "jQuery UI" <jquery-ui@...> Sent: Wednesday, July 02, 2008 5:40 AM Subject: [jquery-ui] Sortable nested elements > > Can sortable handle nested elements? > I have a flatplan app for a magazine - I want to be able to move pages > onto spreads, and move spreads around the flatplan. So a user could > move say page 2 from the first spread onto the 2nd spread, and move > the whole of the second spread to be the, say, 15th spread - and so > on. > Obviously I will need to build some logic that only allows two pages > per spread (printers are so demanding that way) but having used UI > elsewhere am keen to re-use if pos. > I am also looking at jTree to do this - but would prefer to re-use UI > if pos. Is it pos? And any pointers hugely appreciated - virtual pints > of ale all round. > > Many thanks > Ben > > (this is the sort of thing I had in mind ...) > <ol> > <li id="spread_1"> > <ol> > <li id="page_1"><img src=" jpeg of p1" /></li> > <li id="page_2"><img src=" jpeg of p2" /></li> > </ol> > </li> > <li id="spread_2"> > <ol> > <li id="page_3"><img src=" jpeg of p3" /></li> > <li id="page_4"><img src=" jpeg of p4" /></li> > </ol> > </li> > .... > </ol> > > Ben > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsIn my first round of testing, this seems to work just fine. I am using nested divs but it should work the same regardless of the element types. -- Josh ----- Original Message ----- From: "BenR" <ben.rooney@...> To: "jQuery UI" <jquery-ui@...> Sent: Wednesday, July 02, 2008 5:40 AM Subject: [jquery-ui] Sortable nested elements > > Can sortable handle nested elements? > I have a flatplan app for a magazine - I want to be able to move pages > onto spreads, and move spreads around the flatplan. So a user could > move say page 2 from the first spread onto the 2nd spread, and move > the whole of the second spread to be the, say, 15th spread - and so > on. > Obviously I will need to build some logic that only allows two pages > per spread (printers are so demanding that way) but having used UI > elsewhere am keen to re-use if pos. > I am also looking at jTree to do this - but would prefer to re-use UI > if pos. Is it pos? And any pointers hugely appreciated - virtual pints > of ale all round. > > Many thanks > Ben > > (this is the sort of thing I had in mind ...) > <ol> > <li id="spread_1"> > <ol> > <li id="page_1"><img src=" jpeg of p1" /></li> > <li id="page_2"><img src=" jpeg of p2" /></li> > </ol> > </li> > <li id="spread_2"> > <ol> > <li id="page_3"><img src=" jpeg of p3" /></li> > <li id="page_4"><img src=" jpeg of p4" /></li> > </ol> > </li> > .... > </ol> > > Ben > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsWere you able to drag elements out of the nest and then drag them back in the nest if the parent element did not have any existing child elements? (Sorry for the confused wording) I posted this question a few days ago (no response). Reference: http://groups.google.com/group/jquery-ui/browse_frm/thread/280f86fc0abf0df6/d2eb0431af52e36e?lnk=gst&q=skhchiu#d2eb0431af52e36e On Jul 2, 3:56 pm, "Josh Nathanson" <joshnathan...@...> wrote: > In my first round of testing, this seems to work just fine. I am using > nested divs but it should work the same regardless of the element types. > > -- Josh > > ----- Original Message ----- > From: "BenR" <ben.roo...@...> > To: "jQuery UI" <jquery-ui@...> > Sent: Wednesday, July 02, 2008 5:40 AM > Subject: [jquery-ui] Sortable nested elements > > > Can sortable handle nested elements? > > I have a flatplan app for a magazine - I want to be able to move pages > > onto spreads, and move spreads around the flatplan. So a user could > > move say page 2 from the first spread onto the 2nd spread, and move > > the whole of the second spread to be the, say, 15th spread - and so > > on. > > Obviously I will need to build some logic that only allows two pages > > per spread (printers are so demanding that way) but having used UI > > elsewhere am keen to re-use if pos. > > I am also looking at jTree to do this - but would prefer to re-use UI > > if pos. Is it pos? And any pointers hugely appreciated - virtual pints > > of ale all round. > > > Many thanks > > Ben > > > (this is the sort of thing I had in mind ...) > > <ol> > > <li id="spread_1"> > > <ol> > > <li id="page_1"><img src=" jpeg of p1" /></li> > > <li id="page_2"><img src=" jpeg of p2" /></li> > > </ol> > > </li> > > <li id="spread_2"> > > <ol> > > <li id="page_3"><img src=" jpeg of p3" /></li> > > <li id="page_4"><img src=" jpeg of p4" /></li> > > </ol> > > </li> > > .... > > </ol> > > > Ben You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsThere's currently no reliable way to do that. However, it's quite simple to reproduce
a "back dropping" with creating droppables for the items that should be possible to have children, and in the drop callback, simply append the current sortable item to the list. See branches/1.6/tests/tree.html (in SVN) as working example. On Thu, Jul 3, 2008 at 6:10 PM, Simon <skhchiu@...> wrote:
-- -- Paul Bakaus Frontend Architect -- http://paulbakaus.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsSomeone mentioned that doesn't work. I just tried it, and indeed, it does not. -- Josh ----- Original Message ----- From: "Simon" <skhchiu@...> To: "jQuery UI" <jquery-ui@...> Sent: Thursday, July 03, 2008 9:10 AM Subject: [jquery-ui] Re: Sortable nested elements Were you able to drag elements out of the nest and then drag them back in the nest if the parent element did not have any existing child elements? (Sorry for the confused wording) I posted this question a few days ago (no response). Reference: http://groups.google.com/group/jquery-ui/browse_frm/thread/280f86fc0abf0df6/d2eb0431af52e36e?lnk=gst&q=skhchiu#d2eb0431af52e36e On Jul 2, 3:56 pm, "Josh Nathanson" <joshnathan...@...> wrote: > In my first round of testing, this seems to work just fine. I am using > nested divs but it should work the same regardless of the element types. > > -- Josh > > ----- Original Message ----- > From: "BenR" <ben.roo...@...> > To: "jQuery UI" <jquery-ui@...> > Sent: Wednesday, July 02, 2008 5:40 AM > Subject: [jquery-ui] Sortable nested elements > > > Can sortable handle nested elements? > > I have a flatplan app for a magazine - I want to be able to move pages > > onto spreads, and move spreads around the flatplan. So a user could > > move say page 2 from the first spread onto the 2nd spread, and move > > the whole of the second spread to be the, say, 15th spread - and so > > on. > > Obviously I will need to build some logic that only allows two pages > > per spread (printers are so demanding that way) but having used UI > > elsewhere am keen to re-use if pos. > > I am also looking at jTree to do this - but would prefer to re-use UI > > if pos. Is it pos? And any pointers hugely appreciated - virtual pints > > of ale all round. > > > Many thanks > > Ben > > > (this is the sort of thing I had in mind ...) > > <ol> > > <li id="spread_1"> > > <ol> > > <li id="page_1"><img src=" jpeg of p1" /></li> > > <li id="page_2"><img src=" jpeg of p2" /></li> > > </ol> > > </li> > > <li id="spread_2"> > > <ol> > > <li id="page_3"><img src=" jpeg of p3" /></li> > > <li id="page_4"><img src=" jpeg of p4" /></li> > > </ol> > > </li> > > .... > > </ol> > > > Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsDo you refer to my last message? If yes, it does work pretty well for me..can you tell me specifics?
On Thu, Jul 3, 2008 at 6:42 PM, Josh Nathanson <joshnathanson@...> wrote:
-- -- Paul Bakaus Frontend Architect -- http://paulbakaus.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsOK, so the solution is to use droppables in
addition to sortables/draggables. I'll give that a try.
-- Josh
|
|
|
Re: Sortable nested elementsSo far I have two problems - that being the main one. If you take both elements out of a spread so it has no children, then you don't appear to be able to give it any new children. The second problem is, I hope, rather more minor - and that is limiting a spread to having two - and only two children. I suspect that all I have to do is to unpick ui.sortable and find where in the code the actual append is made - and stick in some kind of .length check (and also prevent spreads from being children of other spreads - so will have to do some kind of class check) - but I don't envisage any major problems there - just a question of finding it in the code. I see that Paul B has responded (and maximum respect to you for the plugin - it is a great bit of code) with a pos solution - and also some example in the SVN repository - I will have to have a look at that. On Jul 3, 5:10 pm, Simon <skhc...@...> wrote: > Were you able to drag elements out of the nest and then drag them back > in the nest if the parent element did not have any existing child > elements? (Sorry for the confused wording) > > I posted this question a few days ago (no response). > > Reference:http://groups.google.com/group/jquery-ui/browse_frm/thread/280f86fc0a... > > On Jul 2, 3:56 pm, "Josh Nathanson" <joshnathan...@...> wrote: > > > In my first round of testing, this seems to work just fine. I am using > > nested divs but it should work the same regardless of the element types. > > > -- Josh > > > ----- Original Message ----- > > From: "BenR" <ben.roo...@...> > > To: "jQuery UI" <jquery-ui@...> > > Sent: Wednesday, July 02, 2008 5:40 AM > > Subject: [jquery-ui] Sortable nested elements > > > > Can sortable handle nested elements? > > > I have a flatplan app for a magazine - I want to be able to move pages > > > onto spreads, and move spreads around the flatplan. So a user could > > > move say page 2 from the first spread onto the 2nd spread, and move > > > the whole of the second spread to be the, say, 15th spread - and so > > > on. > > > Obviously I will need to build some logic that only allows two pages > > > per spread (printers are so demanding that way) but having used UI > > > elsewhere am keen to re-use if pos. > > > I am also looking at jTree to do this - but would prefer to re-use UI > > > if pos. Is it pos? And any pointers hugely appreciated - virtual pints > > > of ale all round. > > > > Many thanks > > > Ben > > > > (this is the sort of thing I had in mind ...) > > > <ol> > > > <li id="spread_1"> > > > <ol> > > > <li id="page_1"><img src=" jpeg of p1" /></li> > > > <li id="page_2"><img src=" jpeg of p2" /></li> > > > </ol> > > > </li> > > > <li id="spread_2"> > > > <ol> > > > <li id="page_3"><img src=" jpeg of p3" /></li> > > > <li id="page_4"><img src=" jpeg of p4" /></li> > > > </ol> > > > </li> > > > .... > > > </ol> > > > > Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsI am having the devil's own business trying to sort this out - and any help v much appreciated. I want to do two things - stop people from taking the last child out of a div (to get round the problem of them collapsing) and to limit the number of elements in any one div. I have found the place where we can pick up the class/id etc of the item being moved - but, er, am struggling to find exactly where in ui.sortable the actual append is made to the destination. What I want to be able to do at that point is to test for the number of children - and also the right class. Can anyone point me in the right direction in the code where I need to do this. Sorry for being such a newbie about this ... Ben On Jul 4, 8:59 am, BenR <ben.roo...@...> wrote: > So far I have two problems - that being the main one. If you take both > elements out of a spread so it has no children, then you don't appear > to be able to give it any new children. > The second problem is, I hope, rather more minor - and that is > limiting a spread to having two - and only two children. I suspect > that all I have to do is to unpick ui.sortable and find where in the > code the actual append is made - and stick in some kind of .length > check (and also prevent spreads from being children of other spreads - > so will have to do some kind of class check) - but I don't envisage > any major problems there - just a question of finding it in the code. > I see that Paul B has responded (and maximum respect to you for the > plugin - it is a great bit of code) with a pos solution - and also > some example in the SVN repository - I will have to have a look at > that. > > On Jul 3, 5:10 pm, Simon <skhc...@...> wrote: > > > Were you able to drag elements out of the nest and then drag them back > > in the nest if the parent element did not have any existing child > > elements? (Sorry for the confused wording) > > > I posted this question a few days ago (no response). > > > Reference:http://groups.google.com/group/jquery-ui/browse_frm/thread/280f86fc0a... > > > On Jul 2, 3:56 pm, "Josh Nathanson" <joshnathan...@...> wrote: > > > > In my first round of testing, this seems to work just fine. I am using > > > nested divs but it should work the same regardless of the element types. > > > > -- Josh > > > > ----- Original Message ----- > > > From: "BenR" <ben.roo...@...> > > > To: "jQuery UI" <jquery-ui@...> > > > Sent: Wednesday, July 02, 2008 5:40 AM > > > Subject: [jquery-ui] Sortable nested elements > > > > > Can sortable handle nested elements? > > > > I have a flatplan app for a magazine - I want to be able to move pages > > > > onto spreads, and move spreads around the flatplan. So a user could > > > > move say page 2 from the first spread onto the 2nd spread, and move > > > > the whole of the second spread to be the, say, 15th spread - and so > > > > on. > > > > Obviously I will need to build some logic that only allows two pages > > > > per spread (printers are so demanding that way) but having used UI > > > > elsewhere am keen to re-use if pos. > > > > I am also looking at jTree to do this - but would prefer to re-use UI > > > > if pos. Is it pos? And any pointers hugely appreciated - virtual pints > > > > of ale all round. > > > > > Many thanks > > > > Ben > > > > > (this is the sort of thing I had in mind ...) > > > > <ol> > > > > <li id="spread_1"> > > > > <ol> > > > > <li id="page_1"><img src=" jpeg of p1" /></li> > > > > <li id="page_2"><img src=" jpeg of p2" /></li> > > > > </ol> > > > > </li> > > > > <li id="spread_2"> > > > > <ol> > > > > <li id="page_3"><img src=" jpeg of p3" /></li> > > > > <li id="page_4"><img src=" jpeg of p4" /></li> > > > > </ol> > > > > </li> > > > > .... > > > > </ol> > > > > > Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elements> The second problem is, I hope, rather more minor - and that is > limiting a spread to having two - and only two children. I suspect > that all I have to do is to unpick ui.sortable and find where in the > code the actual append is made - and stick in some kind of .length > check (and also prevent spreads from being children of other spreads - > so will have to do some kind of class check) - but I don't envisage > any major problems there - just a question of finding it in the code. Rather than modifying the source code, maybe you could use the start or stop params to pass in a function that would check the length. -- Josh ----- Original Message ----- From: "BenR" <ben.rooney@...> To: "jQuery UI" <jquery-ui@...> Sent: Friday, July 04, 2008 12:59 AM Subject: [jquery-ui] Re: Sortable nested elements > > So far I have two problems - that being the main one. If you take both > elements out of a spread so it has no children, then you don't appear > to be able to give it any new children. > I see that Paul B has responded (and maximum respect to you for the > plugin - it is a great bit of code) with a pos solution - and also > some example in the SVN repository - I will have to have a look at > that. > > > > On Jul 3, 5:10 pm, Simon <skhc...@...> wrote: >> Were you able to drag elements out of the nest and then drag them back >> in the nest if the parent element did not have any existing child >> elements? (Sorry for the confused wording) >> >> I posted this question a few days ago (no response). >> >> Reference:http://groups.google.com/group/jquery-ui/browse_frm/thread/280f86fc0a... >> >> On Jul 2, 3:56 pm, "Josh Nathanson" <joshnathan...@...> wrote: >> >> > In my first round of testing, this seems to work just fine. I am using >> > nested divs but it should work the same regardless of the element >> > types. >> >> > -- Josh >> >> > ----- Original Message ----- >> > From: "BenR" <ben.roo...@...> >> > To: "jQuery UI" <jquery-ui@...> >> > Sent: Wednesday, July 02, 2008 5:40 AM >> > Subject: [jquery-ui] Sortable nested elements >> >> > > Can sortable handle nested elements? >> > > I have a flatplan app for a magazine - I want to be able to move >> > > pages >> > > onto spreads, and move spreads around the flatplan. So a user could >> > > move say page 2 from the first spread onto the 2nd spread, and move >> > > the whole of the second spread to be the, say, 15th spread - and so >> > > on. >> > > Obviously I will need to build some logic that only allows two pages >> > > per spread (printers are so demanding that way) but having used UI >> > > elsewhere am keen to re-use if pos. >> > > I am also looking at jTree to do this - but would prefer to re-use UI >> > > if pos. Is it pos? And any pointers hugely appreciated - virtual >> > > pints >> > > of ale all round. >> >> > > Many thanks >> > > Ben >> >> > > (this is the sort of thing I had in mind ...) >> > > <ol> >> > > <li id="spread_1"> >> > > <ol> >> > > <li id="page_1"><img src=" jpeg of p1" /></li> >> > > <li id="page_2"><img src=" jpeg of p2" /></li> >> > > </ol> >> > > </li> >> > > <li id="spread_2"> >> > > <ol> >> > > <li id="page_3"><img src=" jpeg of p3" /></li> >> > > <li id="page_4"><img src=" jpeg of p4" /></li> >> > > </ol> >> > > </li> >> > > .... >> > > </ol> >> >> > > Ben > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: Sortable nested elementsYes - that is a *much* better idea. I have been barking up the wrong tree. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@... To unsubscribe from this group, send email to jquery-ui-unsubscribe@... For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free Forum Powered by Nabble | Forum Help |