My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
UpdateToVersion10  
Migration hints for updating from 0.5 to 1.0.
Updated Feb 28, 2011 by moo...@wwwendt.de

When updating from version 0.5 to 1.0, the following aspects have changed and may have to be adjusted.

Main Changes:

  • Built against jQuery 1.4 and jQuery UI 1.8
  • New HTML markup
    Using <ul>/<li> for faster expand / collapse and smoother effects
  • Support for drag'n'drop
    Compatible with jquery.ui.draggable/.droppable but more efficient for a large number of nodes.
  • Modified css
    ui-dynatree-document -> ui-dynatree-node
    Class ui-dynatree-folder is now additionally set (together with ui-dynatree-node)
    rename classes 'ui-dynatree-...' -> 'dynatree-...'

Modified functions:

  • All callbacks have the Dynatree instance as 'this'
  • renamed node.reload() --> reloadChildren()
  • renamed dtnode -> node in the samples
  • Changed node.visit(fn, data, includeSelf) -> node.visit(fn, includeSelf)
    visit() now returns nothing.
    If the callback function returns false, the the traversal is stopped.
    If the callback function returns 'skip', the the traversal of the current branch is stopped.
    (Changes apply also for tree.visit())
  • hasChildren: return 'undefined' if node is unexpanded lazy, or only contains one status node
  • tree.reload(callback) -> new callback parameter
  • replaced node.append() -> node.addChild()

New functions:

  • node.activateSilent()
  • node.fromDict(dict)
  • node.getChildren(), getParent(), getPrevSibling(), getNextSibling()
  • node.getKeyPath(excludeSelf)
  • node.isChildOf(otherNode)
  • node.isDescendantOf(otherNode)
  • node.isFirstSibling()
  • node.isFocused()
  • node.isStatusNode()
  • node.move(targetNode, mode)
  • node.reloadChildren(callback)
  • node.scheduleAction()
  • node.setTitle(title)
  • node.sortChildren(cmp, deep)
  • node.visitParents(fn, includeSelf)
  • tree.disable(), .enable() (shortcut for $("#tree").dynatree("disable"))
  • tree.loadKeyPath()
  • tree.serializeArray()

Other Changes:

  • Distinguish for lazy nodes
    childList == null: 'never loaded'
    childList == : 'loaded, but node has no children'
  • 'noLink' option is available for nodes or the whole tree.
  • generateIds option to enable generation of id attribute (defaults to false)
  • Always hide root node.
    Removed tree.rootVisible (now always hidden)
    Removed tree.title.
  • tree.minExpandLevel must be >= 1
    If a single visible root is wanted, one could always create one using<ul>Top level node expanders are not connected by vlines (requires additional expander icon).
    If minExpandLevel>=1, also the expander icons are hidden, so the first icon column can be removed.
  • Load icon is now displayed in parent (not as sub node)
  • Added a new 'skin-vista'
  • node.appendAjax() triggers event 'nodeLoaded.dynatree.tree-id.node-key'
  • CSS ul.dynatree-container now uses overflow: auto by default
  • The functions
    var tree = $("#elem").dynatree("getTree");
    and
    var node = $("#elem").dynatree("getRoot");
    used to return null, when the tree was not initialized. Now they return an object.

Markup has changed

TODO: how to adjust CSS selectors for the new markup.

    [...]
Powered by Google Project Hosting