Skip to main content

MSWidgetBase

Namespace: Wisej.Web.Ext.MobiScroll

Assembly: Wisej.Web.Ext.MobiScroll (4.1.0.0)

Base class for the MobiScroll widgets, such as EventCalendar, that are hosted in their own control.

public abstract class MSWidgetBase : Widget

The widget loads the MobiScroll packages listed in the Wisej.Web.Ext.MobiScroll.json configuration file and creates the MobiScroll widget identified by the class name passed to the constructor inside the control, using the Options. The static Theme and Culture properties apply to all the MobiScroll widgets in the current session.

Constructors​

Instance member MSWidgetBase(className, options)​

Constructs a new instance of the MSWidgetBase class.

NameTypeDescription
classNameStringThe name of the MobiScroll JavaScript function that creates the widget, i.e. "mobiscroll.eventcalendar".
optionsObjectInitial set of options.

Example:

The following example defines a widget that always shows the MobiScroll event calendar in the agenda view.

public class Agenda : MSWidgetBase
{
public Agenda()
: base("mobiscroll.eventcalendar", new { view = new { agenda = new { type = "week" } } })
{
}
}

Instance member MSWidgetBase(className, html, options)​

Constructs a new instance of the MSWidgetBase class.

NameTypeDescription
classNameStringThe name of the MobiScroll JavaScript function that creates the widget, i.e. "mobiscroll.eventcalendar".
htmlStringOptional HTML to insert in the container; the widget is created on its first element.
optionsObjectInitial set of options.

When html is specified, it replaces the content of the widget's container and the MobiScroll widget is created on the first element of the HTML.

Throws:

Example:

The following example defines a widget that creates the event calendar inside a custom HTML element.

public class MonthCalendar : MSWidgetBase
{
public MonthCalendar()
: base(
"mobiscroll.eventcalendar",
"<div class='month-calendar'></div>",
new { view = new { calendar = new { type = "month" } } })
{
}
}

Properties​

Static member Culture​

CultureInfo: Returns or sets the culture for all the MobiScroll widgets in the current session.

The value is stored in the session; when it is not set, or is set to null, it is CurrentCulture. It replaces the %culture% (i.e. "de-DE") and %locale% (i.e. "de") placeholders in the package URLs of the Wisej.Web.Ext.MobiScroll.json configuration file. Changing the value reloads the packages and recreates all the MobiScroll widgets in the session.

Example:

The following example switches the MobiScroll widgets to German.

MSWidgetBase.Culture = new CultureInfo("de-DE");

Static member Theme​

String: Returns or sets the name of the theme used to load the packages of all the MobiScroll widgets in the current session.

The value is stored in the session and replaces the %theme% placeholder in the package URLs of the Wisej.Web.Ext.MobiScroll.json configuration file; when it is null, the theme field of the configuration file is used. Changing the value reloads the packages of all the MobiScroll widgets in the session.

Example:

The following example selects the theme when the session starts.

// the package URLs in Wisej.Web.Ext.MobiScroll.json must contain the %theme% placeholder.
MSWidgetBase.Theme = "material";

Methods​

Protected member Dispose(disposing)​

Disposes of resources.

ParameterTypeDescription
disposingBoolean

Protected member OnWebRender(config)​

Wire the client config to the server

ParameterTypeDescription
configObject

Inherited By​

NameDescription
EventCalendarThe Mobiscroll Event Calendar displays a list of events in a calendar, scheduler, timeline or agenda view.
SegmentedButtonsDisplays a group of MobiScroll segmented buttons that work like a set of radio buttons.

Implements​