 
 deselectAll = (element) ->
   return unless isSelectable(element)
-  selectedIds = getTemplate(element).selection.removeAll()
-  handleSelectionResult(element, {added: selectedIds, removed: []})
+  deselectedIds = getTemplate(element).selection.removeAll()
+  handleSelectionResult(element, {added: [], removed: deselectedIds})
+
+selectAll = (element) ->
+  return unless isSelectable(element)
+  ids = getTemplate(element).collection.find().map (doc) -> doc._id
+  result = getTemplate(element).selection.setIds(ids)
+  handleSelectionResult(element, result)
 
 toggleSelection = (element, ids) ->
   return unless isSelectable(element)

  template = getTemplate(element)
  return unless isCheckable(element)
  if check
    ids = template.collection.find().forEach (doc) -> doc._id
    changedIds = template.check.setIds(ids).added
    handleCheckResult(element, {added: changedIds, removed: []})
  else

  deselectNode: deselectNode
  setSelectedIds: setSelectedIds
  getSelectedIds: getSelectedIds
  selectAll: selectAll
  deselectAll: deselectAll
  addSelection: addSelection
  removeSelection: removeSelection
