new View(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | Object containing the properties listed below |
Properties:
Name | Type | Description |
---|---|---|
holder |
String | jQuery selector, refers to the element this view should be appended to |
tag |
String | Refers to a riot tag |
static |
Boolean | Indicates whether this is a static View |
Members
-
<static> defaults :Object
-
Default properties of
View
s, these may be overriddenType:
- Object
Properties:
Name Type Argument Default Description holder
String <optional>
'body' Default holder static
String <optional>
false Whether the view is static -
<static> riot :riot
-
Riot object the View uses, this should be used to run compiles, mounts etc. It may be overridden, but this should only done before any View is constructed.
Type:
- riot
-
<static> staticViews :Object
-
All static
View
s will be put on here using their name as the keyType:
- Object
-
$el :jQuery|null
-
The root element wrapped in jQuery
Type:
- jQuery | null
-
$holder :jQuery
-
The holder wrapped in jQuery
Type:
- jQuery
-
el :HTMLElement|null
-
The root element of this view
Type:
- HTMLElement | null
Methods
-
hide()
-
Hides the
View
-
hide()
-
Removes the
View
-
render(data)
-
Renders the riot tag to the DOM (into the $holder)
Parameters:
Name Type Description data
Object Data to be made available to the riot tag -
show()
-
Shows the
View
-
sync(data)
-
Syncs data to the riot tag
Parameters:
Name Type Description data
Object Data for the riot tag, will be extended with the current data