item
Overview
An item
in the general-section
is similar to that in a section
. These provide users a way to perform an action or navigate to a view. See more information here.
In addition to customizable items, the general-section
contains a number of non-customizable items, namely links to the "Messages", "Set Language" and "About" screens.
Basic Example

Standard Attributes
label
label
on-press
on-presson-press
validate
validate
Optional
Type: boolean
Default: false
Validation will check all required fields on the view and confirm that they contain values before performing the on-press
action.
<item label="User details" on-press="$:userDetails()" validate="true" />
Advanced Attributes
from-js
from-js
id
id
icon
icon
indicator
indicator
items
items
show-if
and hide-if
show-ifhide-ifshow-if
and hide-if
type
type
Optional
Type: messages
Default: The default messages page will be setup and included in the general-section
.
Overrides the default Messages item
in the general-section
. It is important to also specify an indicator
for this item
.
<general-section>
<item type="messages"
label="Custom Messages"
on-press="$:navigate.link('custom_messages')"
indicator="$:messageIndicator()" icon="far fa-envelope" />
</general-section>
function messageIndicator() {
var messages = DB.push_notification.where(
"user = ? and status = ?",
user,
null
);
var count = messages.count();
return count == 0 ? null : { value: count, color: "negative" };
}
Last updated