cancel
Showing results for 
Search instead for 
Did you mean: 

[Webscript][Javascript] Retrieve the current path

lamba
Champ on-the-rise
Champ on-the-rise
Hello All,

I'm developing webscript under share and I need some parameters on my javascript of the documentLibrary page.
I've got the current site using the expression "page.url.templateArgs.site"
the current container  using the expression "template.properties.container"

Unfortunately, I can't get the current path or filterData.
I used the expressions "page.url.args.path" and "page.url.args.filterData" but no one is working.

Thanks for help.
4 REPLIES 4

lamba
Champ on-the-rise
Champ on-the-rise
I also tried page.url.templateArgs.path & url.templateArgs["path"] but without success!

Nobody has any idea!

mikeh
Star Contributor
Star Contributor
The document library template removes query string parameters and changes them to hash params so that "ajax history" based navigation can be accomplished on the client.

You'll either have to modify the document library template to store the original path in a context variable before removing it, or read the path from the clientside instead.

Thanks.
Mike

lamba
Champ on-the-rise
Champ on-the-rise
Thanks Mike for reply,

How can I read the path from the clientside?

mikeh
Star Contributor
Star Contributor
The best way is to listen for a "filterChanged" event and see if the filterId is "path". The new path will be in filterData.

YAHOO.Bubbling.on("filterChanged", this.onFilterChanged, this);

Have a look at the tree.js code for examples.

Thanks,
Mike