I would like to be able to move an entry among it''s siblings on the same level. Is it possible to reference a neighbor sibling without knowing it''s id, (i.e. next neighboring sibling right or left)?
Krishna Dole
2007-Jan-09 18:13 UTC
[Betternestedset-talk] Reference to neighboring sibling
Hi Tony, Fabien Franzen has just sent me a patch with that sort of functionality. I''ll try to apply it soon, though I''m busy this week. In the meantime, you can fairly easily accomplish it with code like this (untested): sibs = node.siblings node.move_to_right_of(sibs[sibs.index_of(node)] + 1) (this code doesn''t catch condition of node being last sibling) Krishna On 1/9/07, Tony K. <tony.kruse at gmail.com> wrote:> I would like to be able to move an entry among it''s siblings on the > same level. Is it possible to reference a neighbor sibling without > knowing it''s id, (i.e. next neighboring sibling right or left)? > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk >