cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to retrieve part of a tree

khayes1
13-Aquamarine

How to retrieve part of a tree

Hi,

does anyone know if are there any in built File Repository services that will return just part of a given directory structure.

 

I have a custom file repository thing (for each customer). Within the repository I have a folder for each asset owned by the customer. Each asset folder has a number of sub folders.

I have a mash up that has a tree widget. I would like to populate the tree with just the selected assets folders & files. Is there a built in way to do this, or would I have to write my own?

 

Thanks,

K

1 ACCEPTED SOLUTION

Accepted Solutions

On your service, add this fake row:

result.AddRow({ path: yourRootThingFolderPath, parentPath: "", name: "/" });

View solution in original post

4 REPLIES 4

You should use ListDirectories services recursively, it's how we do for the exact same situation as yours.

khayes1
13-Aquamarine
(To:CarlesColl)

Hi Carles,

thanks for the quick response. I took your advice, but am having problems getting the result to display in the tree widget. I wonder if you can see anything obvious? I use the same service to populate a grid widget (for debug) and a tree widget. The service is just a wrapper service around ListDirectories and I believe the data returned is correct.

var printerPath = "/Printers/"+PrinterID;

var params = {

path: printerPath /* STRING */,

nameMask: undefined /* STRING */

};

// result: INFOTABLE dataShape: "FileSystemDirectory"

var result = me.ListDirectories(params);

I think I have the tree widget configured correctly, but don't see any data.

Can you see anything obvious that I am doing wrong. I have so much trouble with tree widgets.

Thanks,

K

On your service, add this fake row:

result.AddRow({ path: yourRootThingFolderPath, parentPath: "", name: "/" });

khayes1
13-Aquamarine
(To:CarlesColl)

Hi Carles,

thanks, you are a legend. That's sorted it now.

Cheers,

Kieron

Top Tags