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.
- C#
- VB.NET
public abstract class MSWidgetBase : Widget
Public MustInherit Class MSWidgetBase
Inherits 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
MSWidgetBase(className, options)
Constructs a new instance of the MSWidgetBase class.
| Name | Type | Description |
|---|---|---|
| className | String | The name of the MobiScroll JavaScript function that creates the widget, i.e. "mobiscroll.eventcalendar". |
| options | Object | Initial 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" } } })
{
}
}
MSWidgetBase(className, html, options)
Constructs a new instance of the MSWidgetBase class.
| Name | Type | Description |
|---|---|---|
| className | String | The name of the MobiScroll JavaScript function that creates the widget, i.e. "mobiscroll.eventcalendar". |
| html | String | Optional HTML to insert in the container; the widget is created on its first element. |
| options | Object | Initial 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:
- ArgumentNullException className is null or empty.
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
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");
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
Dispose(disposing)
Disposes of resources.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean |
OnWebRender(config)
Wire the client config to the server
| Parameter | Type | Description |
|---|---|---|
| config | Object |
Inherited By
| Name | Description |
|---|---|
| EventCalendar | The Mobiscroll Event Calendar displays a list of events in a calendar, scheduler, timeline or agenda view. |
| SegmentedButtons | Displays a group of MobiScroll segmented buttons that work like a set of radio buttons. |