for what purpose do you need left and right values for serialisation? Isn't it enough to store the hierarchial structure in multidimensional arrays?
like url.php?tree[0]=folder1&tree[0][0]=subfolder1&tree[0][1]=subfolder2&tree[1]=folder2
then afterwards in php or whatever parse the array and create your right and left values for the database yourself if you want to.
2006/10/30, Philippe Jadin <[EMAIL PROTECTED]>:
> params[:item].each {|id, hash| Item.find(id).update_attributes(hash)}
>
> Which should convert the serialized data into the acts_as_nested_set. Make
> sense?
It does. I'm wondering what happens if you have a very large tree
(+10.000 nodes) and you load part of it on demand. In this situation,
the whole tree is never loaded at once for scalability reasons, so it
is not possible to compute the left and right values client side.
Maybe it's a specific use case. If so, another serializer could be
written that only sends parent_id information for the loaded tree ?
I never used act_as_nested_set, but my implementation allows you to
add nodes in an arbitrary order, then you can "rebuild" the tree. It
is also possible to add a node anywhere without rebuilding the nested
set.
There is an article on the difference between "adjacency list" (parent
id) and what they call "modified preorder tree traversal" (left +
right) :
http://www.sitepoint.com/article/hierarchical-data-database/2
Something else that came to mind : is it possible to allow other
parameters to be sent? Like a 'modified' flag, so we can only update
the DB with modified nodes.
All this is very cool to have in jquery, thanks a lot for making it happen!
--
Philippe Jadin
Thinkedit, a flexible
data and content
management system :
http://www.thinkedit.org
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Paul Bakaus
Web Developer
------------------------
Hildastr. 35
79102 Freiburg
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
