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. |
IMUrlHashParameters | Get the HashObject of the current URL. | |
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): void
Change to a dialog.
Parameters
Parameter | Type | Notes |
---|---|---|
dialog | string | The id of the dialog to change to |
Returns
void
changePage
Class MethodchangePage(pageId: string): void
Change to a page.
Parameters
Parameter | Type | Notes |
---|---|---|
page | string | the id of the page to change to |
Returns
void
changeQueryObject
Class MethodchangeQueryObject(queryObject: UrlParameters, options?: { isReplaceQueryObject?: boolean; replaceHistory?: boolean }): void
Change 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
void
changeUrlHashObject
Class MethodchangeUrlHashObject(urlHashParametersObject: IMUrlHashParameters, options?: { isReplaceHashObject?: boolean; replaceHistory?: boolean }): 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.
Parameters
Parameter | Type | Notes |
---|---|---|
url | IMUrlHashParameters | can be partial of hash object |
options | { isReplaceHashObject?: boolean; replaceHistory?: boolean } |
|
Returns
void
changeView
Class MethodchangeView(sectionId: string, viewId: string): void
Change 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
void
getHashObject
Class MethodgetHashObject(): IMUrlHashParameters
Get the HashObject of the current URL.
Returns
IMUrlHashParameters
getQueryObject
Class MethodgetQueryObject(): UrlParameters
Get the QueryObject of the current URL.
Returns
UrlParameters
init
Class Methodinit(store: Store<IMState, UnknownAction, unknown>): { queryObject: UrlParameters; urlHashObject: UrlHashParameters }
Initialize QueryObject and HashObject in the URL
Parameters
Parameter | Type | Notes |
---|---|---|
store | Store<IMState, UnknownAction, unknown> | exb app store |
Returns
{ queryObject: UrlParameters; urlHashObject: UrlHashParameters }
setWidgetUrlParams
Class MethodsetWidgetUrlParams(widgetId: string, hashParameters: UrlWidgetSpecificParams, options?: { isReplaceHashObject?: boolean }): void
Set 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