Calculations.

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Calculations.

Postby Roberto Blasco » Tue Dec 22, 2015 12:01 pm

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
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: [email protected]
User avatar
Roberto Blasco
007
 
Posts: 341
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain

Re: Calculations.

Postby patrick » Tue Dec 22, 2015 12:13 pm

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3633
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Calculations.

Postby patrick » Tue Dec 22, 2015 12:17 pm

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)

Code: Select all
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]
   }
}
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3633
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Calculations.

Postby Roberto Blasco » Tue Dec 22, 2015 12:21 pm

Thanks a lot Patrick. :-)
Un saludo. Roberto.

Madrid - Spain
Tfno: (+34) 625653066
E-mail: [email protected]
User avatar
Roberto Blasco
007
 
Posts: 341
Joined: Tue Apr 08, 2008 7:18 pm
Location: Madrid / Spain


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 6 guests