Class
The UrlManager is used to manage URL parameters.
Methods
| Method | Returns | Notes |
|---|---|---|
changeDialog(dialogId) | void | Change to a dialog. |
changePage(pageId) | void | Change to a page. |
changeQueryObject(queryObject, options?) | void | Change the query string in URL using the queryObject, only the passed in params you need to change. |
changeUrlHashObject(urlHashParametersObject, options?) | void | To change the hash string in the URL, pass in an object with the key/values that you want to change in the hash string. Hash string values that are not included in the object will stay the same. |
changeView(sectionId, viewId) | void | Change to a view. |
getHashObject() | IMUrlHashParameters | Get the HashObject of the current URL. |
getQueryObject() | UrlParameters | Get the QueryObject of the current URL. |
init(store) | { queryObject: UrlParameters; urlHashObject: UrlHashParameters } | Initialize QueryObject and HashObject in the URL |
setWidgetUrlParams(widgetId, hashParameters, options?) | void | Set the corresponding hash parameters for a specific widget. |
changeDialog
Class MethodchangeDialog(dialogId: string): voidChange to a dialog.
Parameters
| Parameter | Type | Notes |
|---|---|---|
dialog | string | The id of the dialog to change to |
Returns
voidchangePage
Class MethodchangePage(pageId: string): voidChange to a page.
Parameters
| Parameter | Type | Notes |
|---|---|---|
page | string | the id of the page to change to |
Returns
voidchangeQueryObject
Class MethodchangeQueryObject(queryObject: UrlParameters, options?: { isReplaceQueryObject?: boolean; replaceHistory?: boolean }): voidChange the query string in URL using the queryObject, only the passed in params you need to change.
- To replace all query params, set
replaceQueryObject=true - To remove a query param, set the param as null
Parameters
| Parameter | Type | Notes |
|---|---|---|
query | UrlParameters | can be partial of query object |
options | { isReplaceQueryObject?: boolean; replaceHistory?: boolean } |
|
Returns
voidchangeUrlHashObject
Class MethodchangeUrlHashObject(urlHashParametersObject: IMUrlHashParameters, options?: { isReplaceHashObject?: boolean; replaceHistory?: boolean }): voidTo change the hash string in the URL, pass in an object with the key/values that you want to change in the hash string. Hash string values that are not included in the object will stay the same.
Parameters
| Parameter | Type | Notes |
|---|---|---|
url | IMUrlHashParameters | can be partial of hash object |
options | { isReplaceHashObject?: boolean; replaceHistory?: boolean } |
|
Returns
voidchangeView
Class MethodchangeView(sectionId: string, viewId: string): voidChange to a view.
Parameters
| Parameter | Type | Notes |
|---|---|---|
section | string | The id of the section that the view belongs to |
view | string | The id of the view to change to |
Returns
voidgetHashObject
Class MethodgetHashObject(): IMUrlHashParametersGet the HashObject of the current URL.
Returns
IMUrlHashParametersgetQueryObject
Class MethodgetQueryObject(): UrlParametersGet the QueryObject of the current URL.
Returns
UrlParametersinit
Class Methodinit(store: Store<IMState>): { queryObject: UrlParameters; urlHashObject: UrlHashParameters }Initialize QueryObject and HashObject in the URL
Parameters
| Parameter | Type | Notes |
|---|---|---|
store | Store<IMState> | exb app store |
Returns
{ queryObject: UrlParameters; urlHashObject: UrlHashParameters }setWidgetUrlParams
Class MethodsetWidgetUrlParams(widgetId: string, hashParameters: UrlWidgetSpecificParams, options?: { isReplaceHashObject?: boolean }): voidSet the corresponding hash parameters for a specific widget.
Parameters
| Parameter | Type | Notes |
|---|---|---|
widget | string | The id of a specific widget |
hash | UrlWidgetSpecificParams | The corresponding UrlHash parameter object |
options | { isReplaceHashObject?: boolean } |
Example 1: set widget-url-params Example 2: remove widget-url-params Example 3: clear widget-url-params |
Returns
void