Back to Devexpress

MobileLayoutExtension Class

dashboard-js-devexpress-dot-dashboard-af0bb141.md

latest4.1 KB
Original Source

MobileLayoutExtension Class

A Web Dashboard extension that allows you to enable a mobile layout for phones.

Declaration

ts
export class MobileLayoutExtension implements ISupportOptionExtension<MobileLayoutExtensionOptions>

Remarks

When registered, the MobileLayoutExtension allows you to use a mobile layout to display your dashboards on mobile phones. The Web Dashboard supports a mobile layout when operates in the Viewer and ViewerOnly modes.

To disable a mobile layout, call the unregisterExtension(extensionNames) method and pass the extension’s unique name as a parameter:

javascript
dashboardControl.unregisterExtension('mobileLayout');

To learn more about a mobile layout, see Mobile Layout in ASP.NET Core.

See the following topic for information on how to use the DashboardControl’s client-side API: Extensions Overview.

Implements

ISupportOptionExtension

constructor(dashboardControl)

Initializes a new instance of the MobileLayoutExtension class.

Declaration

ts
constructor(
    dashboardControl: DevExpress.Dashboard.DashboardControl,
    options?: MobileLayoutExtensionOptions
)

Parameters

NameTypeDescription
dashboardControlDashboardControl

A Web Dashboard control that owns the extension.

| | options | MobileLayoutExtensionOptions |

A MobileLayoutExtensionOptions object providing access to the MobileLayoutExtension options.

|

Properties

mobileLayoutEnabled Property

Gets whether a mobile layout is enabled for the current Web Dashboard control.

Declaration

ts
mobileLayoutEnabled: ko.Computed<boolean>

Property Value

TypeDescription
Computed<boolean>

true, if a mobile layout is enabled; otherwise, false

|

Remarks

You cannot change the mobileLayoutEnabled property value using the DashboardControl.option method. Set this property before the control is rendered.

To learn more about a mobile layout, see Mobile Layout in ASP.NET Core.

name Property

Specifies the unique extension name.

Declaration

ts
name: string

Property Value

TypeDescription
string

The unique extension name. The return value is mobileLayout.

|

Remarks

Use the mobileLayout name in the following cases:

  • Call the DashboardControl.findExtension method and pass the extension name as a parameter to access the extension.
  • Call the control’s option method to change the extension options.

Warning

Do not change the unique name of the extension registered in the Web Dashboard to avoid exceptions.

Methods

start Method

Contains code that is executed when you register the dashboard extension.

Declaration

ts
start(): void

stop Method

Contains code that is executed when you unregister the dashboard extension.

Declaration

ts
stop(): void