Dojo Tree

Hello,
I need to implement a drag and drop tree in rails. I saw the demo of the
dojo tree and that is something that i wwould like to have. Can anyone
please tell me how do i make that tree by getting the data from the
DATABASE table and not from the file as given in the dojo example.
Thank you.
Regards,
Anks

That’s impossible to answer in any specific way without knowing what
demo you’re talking about and knowing your data’s structure in the
database, but I can guess at generalities:

  • the demo is parsing the file and putting it in some kind of structure
  • this structure is then fed through some code and handed to Dojo

So, for Rails, you have two problems:

  • using Rails associations and finders to extract data from the
    database and manipulate it into a form that can be fed through some
    code and handed to Dojo.
  • Running Dojo on Rails.

For the first problem you’ll have to look at the structure of the tree
in the example and attempt to replicate that structure (or,
alternatively, cut out the intermediate code and look for a way to
hand the manipulated tree to Dojo directly).

For the second, there is at least one project (Dojo Toolbawks) to let
you run Dojo with Rails.

-faisal

Have the model that describes the content you want to sort uses
acts_as_tree, then use the example code from this page
http://dev.oriontransfer.co.nz/SortableTree/ to figure out how to use
the
Scriptaculous library. I don’t know if the most current Rails install
version of dragdrop.js works - when I implemented this on my site a year
or
so ago, I needed to use the dragdrop.js from the example.

Cynthia K. wrote:

Have the model that describes the content you want to sort uses
acts_as_tree, then use the example code from this page
http://dev.oriontransfer.co.nz/SortableTree/ to figure out how to use
the
Scriptaculous library. I don’t know if the most current Rails install
version of dragdrop.js works - when I implemented this on my site a year
or
so ago, I needed to use the dragdrop.js from the example.

Hello,
I saw the demo and this is what i would like to have. But
unfortunately i could not find the source code. Do you have any idea
where i can find the source code for the sortable tree.

Hello
Do you find the source code of example or maybe another simular
solution?