[Midas] CALLBACK_CORE_RESOURCES_SELECTED
Mona Wong
mona at sdsc.edu
Fri Jul 6 20:43:41 EDT 2012
How do I get the item's parent (directory) information in the javascript?
thanks,
Mona
On Jul 6, 2012, at 8:01 AM, Zach Mullen wrote:
> The callback only receives a list of id's for items that are selected. You can map that id to their name from the DOM though:
>
> if(params.items.length > 0) {
> var itemId = params.items[0];
> var itemName = $('#browseTable tr[type="item"][element="'+itemId+'"] td:first span').html();
> console.log(itemName);
> ...
> }
>
>
> In the javascript code you can print the contents of a variable recursively to the console by using:
>
> console.log(variable);
>
> This works really well on Chrome, and I'm pretty sure also on Firefox. It's my preferred method of debugging :)
>
> Thanks,
>
> Zach
*********************************************
Mona Wong
Web & iPad Application Developer
San Diego Supercomputer Center
"Forgive everyone everything."
-- Regina Brett
*********************************************
More information about the Midas
mailing list