Calculations.

Hi all and Merry Christmas !!!

Two questions … :-)

Are calculations able to return an object like an UUID array ?

And the second one …

Can I use those UUID arrays to use them in DBTreeTableView with the method setExpandNode ?

Best Regards and thanks in advance

First question: yes, calculations of type “media” could return a UUID array. Second question: you could use that for the tree, but I think the tree wants a UUID string array, not a UUID object array.

You could fairly easily calculate the full path to the root when you have a given node. In the node you could do something like this in a calculation (out of my head)

function tree_path() {
   if (utils.hasRecords(relation_to_parent)) {
      var parentPath = relation_to_parent.tree_path;
      parentPath.push(node_id);
      return parentPath;
   } else {
      return [node_id]
   }
}

Thanks a lot Patrick. :-)