     @nodes[@getNodeId nodeData] = {}
 
     if options.putDepthInfo
-      if @nodes[@getNodePId nodeData]?.getData?
+      if @nodes[@getNodePId nodeData]
         nodeData.depth = @nodes[@getNodePId(nodeData)].getData().depth + 1
       else
         nodeData.depth = 0

    nodeData = nodeView.getData()
    nodeView.$().attr "draggable","true" if @getOptions().dragdrop
    {id, parentId} = nodeData

    @nodes[@getNodeId nodeData] = nodeView
    if @nodes[@getNodePId nodeData]
      @expand @nodes[@getNodePId nodeData] unless @getOptions().addListsCollapsed
      # todo: make decoration with events
      @nodes[@getNodePId nodeData]?.decorateSubItemsState?()
    return unless @listControllers[id]
    @addSubList nodeView, id



  expand:(nodeView)->

    nodeData = nodeView.getData()
    nodeView.expand()
    @listControllers[@getNodeId nodeData]?.getView().expand()

  collapse:(nodeView)->

