Silk
The Silk class defines the global methods, properties, and events of a SilkBuilder application. It is uniquely instantiated as the silk object when the <silk:App> tag is processed in the application. Other components use the created silk object for their internal operations. The user does not need to instantiate this class.
Kind: global class
Properties
pageList
Array
An array containing the list of Page objects used by the application.
dpLoader
Array
An array containing the list of DataProvider objects used by the application.
$screen
Object
A jQuery object pointing to the page's container.
focusedPage
String
The name of the page is currently in focus.
Constructor
new Silk()
Returns a Silk instance. Do not instantiate manually.
Methods
alert(title, message, icon, configuration)
Extends the SweetAlert2 dialog object. Use it by calling alert(title, message, icon); or alert(configuration_object);.
Kind: instance method of Silk
title
String
The dialog's title.
message
String
The dialog's message.
icon
String
The icon's name.
configuration
Object
An object with the SweetAlert2 configuration. When using this, the other parameters should not be used.
getScreenMode() ⇒ Integer
IntegerReturns the screen mode based on the window's width. The return values are:
0 - Small. Under 544px width.
1 - Medium. Between 544px and 769px.
2 - Regular. Between 768px and 1025px.
3 - Large. Between 1024px and 1401px.
4 - Extra Large. Between 1400px and 1900px.
5 - Extra extra large. Above 1900px;
Kind: instance method of Silk
layoutScreens()
Distributes and visualizes the pages based on the screen's width.
Kind: instance method of Silk
on
Load events to respond to the global interactions. To set an event, use this code: on(<eventName>, function(){<code>}).
Kind: instance property of Silk
eventName
String
The event's name.
eventFunction
function
The function to be triggered.
toast(title, message, icon, configuration)
Extends the SweetAlert2 toas object. The toast is a window that delivers a message, opening for a few seconds. Use it by calling toast(title, message,icon); or toast(configuraition_object);.
Kind: instance method of Silk
title
String
The dialog's title.
message
String
The dialog's message.
icon
String
The icon's name.
configuration
Object
An object with the SweetAlert2 configuration. When using this, the other parameters should not be used.
"event:afterDPLoad"
This event is triggered after the DataProviders marked with autoLoad=true have finished loading for the first time. Created with the on("afterDPLoad", function(){}) method.
Kind: event emitted by Silk
"event:beforeDPLoad"
This event is triggered before the DataProviders marked with autoLoad=true are loaded for the first time. Created with the on("beforeDPLoad", function(){}) method.
Kind: event emitted by Silk
Events
on:resize
This event is triggered every time the navigator is resized. It is also triggered after the pages have been distributed. Created with the on("resize", function(){}) method.
Kind: event emitted by Silk
Last updated

