How to get sub-nodes of a node ? (node names)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2009 06:37 AM
Hello
could somebody indicate me a Javascript methode that mat give me the subnode names when a script in run on a parent directory (not recursive, only first level is asked).
For example, I have a structure:
Parent_Space
|—— SubSpace1
|—— SubSpace2
|—— SubSpace3
I would like to have something that may give me a list of containing the 3 strings "SubSpace1", "SubSpace2" and "SubSpace3" when i execute a script at "Parent_Space" level.
Thanks for any help !
Regards
Matt
could somebody indicate me a Javascript methode that mat give me the subnode names when a script in run on a parent directory (not recursive, only first level is asked).
For example, I have a structure:
Parent_Space
|—— SubSpace1
|—— SubSpace2
|—— SubSpace3
I would like to have something that may give me a list of containing the 3 strings "SubSpace1", "SubSpace2" and "SubSpace3" when i execute a script at "Parent_Space" level.
Thanks for any help !
Regards
Matt
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2009 07:44 AM
See http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook#Iterating_values_using_JavaScript_syntax_for_e...
So, I guess :
Then, variable "myString" will hold : "SubSpace1;SubSpace2;SubSpace3;"
So, I guess :
var myString = "";for each (child in space.children){ myString += child.name + ";";}‍‍‍‍‍‍‍‍
Then, variable "myString" will hold : "SubSpace1;SubSpace2;SubSpace3;"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2009 07:49 AM
Hi !
OK, that's working… thanks !
Any way to have only sub spaces ? (currently if I have a document, it is also listed)
Regards
Matt
OK, that's working… thanks !
Any way to have only sub spaces ? (currently if I have a document, it is also listed)
Regards
Matt

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2009 08:46 AM
var myString = "";for each (child in space.children){if(child.isContainer) { myString += child.name + ";";}}‍‍‍‍‍‍‍‍‍‍
Hope this helps
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2009 08:54 AM
Thanks !
I think that the topic is now closed
MAtt
I think that the topic is now closed

MAtt

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2009 09:04 AM
Sure.
Don't forget to have a look at the wiki.
Everything I wrote was from here :
http://wiki.alfresco.com/wiki/Category:JavaScript_API
Don't forget to have a look at the wiki.
Everything I wrote was from here :
http://wiki.alfresco.com/wiki/Category:JavaScript_API
