All docs
V17.2
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
The page you are viewing does not exist in version 19.2.
19.1
The page you are viewing does not exist in version 19.1.
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

jQuery SPA Framework - Router

An object responsible for routing.

import Router from "devextreme/framework/router"
Type:

Object

The DevExtreme SPA framework comes with an integrated navigation system that allows you to navigate to views easily - by specifying the view name along with the associated parameters. To encode navigation information to a URI and then decode it from the URL fragments, routing rules must be defined in the application. The Router object allows you to register routing rules to be used for navigation. Use the Router's register() method to add a routing rule.

To parse a URI or format an object to a URI, use the Router's parse(uri) and format(obj) methods respectively.

To learn more about routing rules, refer to the Declare a Routing topic.

Methods

This section describes the methods used to manipulate the application's navigation routing.

Name Description
format(obj)

Formats an object to a URI.

parse(uri)

Decodes the specified URI to an object using the registered routing rules.

register(pattern, defaults, constraints)

Adds a routing rule to the list of registered rules.