Manage the AskiaPortal (top frame) navigation. Because the URL already refers to AskiaPortal and we don't want to navigate elsewhere, all the navigation methods ane events will refers to the hash or query part of the URL.
// The current URL on AskiaPortal is:
// https://my.server.addr/AskiaPortal/#/MyModule/
portal.navigation.redirect("Surveys/1");
// Will redirect to: https://my.server.addr/AskiaPortal/#/MyModule/Surveys/1
portal.navigation.redirectToModule("AnotherModule", "Surveys/1");
// Will redirect to: https://my.server.addr/AskiaPortal/#/AnotherModule/Surveys/1
portal.navigation.setQuery({param1: "value1", param2: "value2"});
// Will redirect to: https://my.server.addr/AskiaPortal/#/MyModule?param1=value1¶m2=value2
Dependencies:
- ./js/portal.channel.js
Methods
(static) mergeQuery(query) → {Promise}
Merge the query part of the AskiaPortal URL.
// The current URL on AskiaPortal is:
// https://my.server.addr/AskiaPortal/#/MyModule/?param1=value1¶m3=value3
portal.navigation.mergeQuery({param1: "anotherValue1", param2: "value2"});
// Will redirect to: https://my.server.addr/AskiaPortal/#/MyModule?param1=anotherValue1¶m2=value2¶m3=value3
Parameters:
Name | Type | Description |
---|---|---|
query |
Object | Query to merge in the URL |
Returns:
- Type
- Promise
(static) redirect(urlHash) → {Promise}
Redirect the AskiaPortal to the specified relative url hash.
// The current URL on AskiaPortal is:
// https://my.server.addr/AskiaPortal/#/MyModule/
portal.navigation.redirect("Surveys/1/Details");
// Will redirect to: https://my.server.addr/AskiaPortal/#/MyModule/Surveys/1/Details
Parameters:
Name | Type | Description |
---|---|---|
urlHash |
String | URL hash to redirect to. |
Returns:
- Type
- Promise
(static) redirectToModule(moduleUrl, urlHashopt) → {Promise}
Redirect the AskiaPortal to the specified module.
portal.navigation.redirectToModule("AnotherModule");
// Will redirect to: https://my.server.addr/AskiaPortal/#/AnotherModule
portal.navigation.redirectToModule("AnotherModule", "Surveys/1");
// Will redirect to: https://my.server.addr/AskiaPortal/#/AnotherModule/Surveys/1
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
moduleUrl |
String | Root URL of the module |
||
urlHash |
String |
<optional> |
'' | URL hash to redirect to. |
Returns:
- Type
- Promise
(static) setQuery(query) → {Promise}
Set the query part of the AskiaPortal URL.
// The current URL on AskiaPortal is:
// https://my.server.addr/AskiaPortal/#/MyModule/
portal.navigation.setQuery({param1: "value1", param2: "value2"});
// Will redirect to: https://my.server.addr/AskiaPortal/#/MyModule?param1=value1¶m2=value2
Parameters:
Name | Type | Description |
---|---|---|
query |
Object | Query to set into the URL |
Returns:
- Type
- Promise