Skip to content

Detail View Layout

mmorton edited this page Aug 18, 2010 · 5 revisions

Detail View Layout

The layout for a detail view is comprised of a list of layout definitions. Currently, there are three types of definitions.

Section Definitions

This definition type is determined by the presence of an as property which contains another layout to use. Sections are rendered after the primary section and though sections can be nested indefinitely, they are rendered sequentially in the order they are defined.

You can also specify an options property, which accepts the following settings:

  • title: The title to be displayed for the section.
  • list: true to render the section as a list, false to render it as a field set.

Related Properties

This definition type is determined by the presence of an view property which contains the ID of the view to link to.

A number of other properties can be defined on this definition:

  • property: true to render the link out in a similar format to a property, false otherwise.
    • When true all standard property options apply as well.
    • This is usually set to true when linking to a detail view and/or when in-line with other, non-linking properties; false when linking to a list view and/or when contained in a related items section.
  • key: By default, a dot-path expression to fetch the key to be passed to the linked view.
    • This value is generally used when linking to a detail view and is exclusive with where.
  • where: An SData query expression to be passed to the linked view.
    • This value is generally used when linking to a list view and is exclusive with key.
  • resourceKind: The resource kind to be passed to the linked view. This value is not commonly used.
  • resourcePredicate: The resource predicate to be passed to the linked view. This value is not commonly used.

Standard Properties

This definition type is the determined by the absense of other markers and is the default type. It is used for displaying data.

A number of properties can be defined on this definition:

  • label: A label to be displayed.
  • icon: An icon to be displayed.
  • name: The property to be displayed.
  • provider: A value provider that extracts the value from the SData feed entry.
    • By default this is the dot-path provider, Sage.Platform.Mobile.Utility.getValue, which extracts the value based on it’s dot-path expression.
    • This provider is also used when extracting the key property on related property definitions.
    • If no name is specified, the default provider will return the entire SData feed entry.
  • render: A function that accepts the raw value and returns the formatted display value.
    • This property is mutually exclusive with tpl.
  • tpl: A Simplate that will be passed the raw value and rendered.

Clone this wiki locally