Class: List

XV. List

Displays a scrolling list of rows.
Handles lazy loading. Passes in the first 50 items, and as one scrolls, passes more.
Use to display large lists, typically a collection of records retrieved from the database, for example a list of accounts, addresses, contacts, incidents, projects, and so forth. But can also be used to display lists stored elsewhere such as state or country abbreviations.
Related: list, XV.List; row, XV.ListItem; cell, XV.ListColumn; data, XV.ListAttr
Derived from enyo.List.
Note: enyo.List includes a scroller; therefore, XV.List should not be placed inside a scroller.

new List()

Source:

Extends

Members

formatted

An array of data types that require special formatting in displays
Inherited From:
Source:

published :Object

Published fields
Type:
  • Object
Properties:
Name Type Description
canAddNew Boolean
actions. Array Array of objects. What actions that we allow on the list item? Currently supported fields of the object are name {String} The name of the action label {String} Menu item label. Default ("_" + name).loc() notify {Boolean} Do we want to verify with the user? Default true. notifyMessage {String} Overrides default notify message. optional. prerequisite {String} the name of an editeable-model class method that will verify if the user can perform this action on this item. Asyncronous. First param is a callback function that must be called with true or false, even if syncronous. Leave this out if the user can always take the action. method {String} the name of an enyo method in XV.FooList, or a class method on the editable model. isViewMethod {Boolean}
label String
Source:

Methods

callPhone()

If the device has phone capability, this will dial the phone number value.
Source:

collectionChanged()

Source:
To Do:
  • Document the collectionChanged method.

create()

Source:
To Do:
  • Document the create method.

createOverflowRow()

Creates an additional hidden row which can be used if more space is needed for columns added during layout changes. XXX yes, this is incompatible with View templates. so ListItems that want to use overflow rows cannot yet use View templates.
Source:

doDownload()

Show the report in another tab and download pdf.
Source:

doEmail()

If email is available, email the report. Otherwise, show the report in another tab.
Source:

doPrint()

If a printer is available, print the report silently through the model. Otherwise, show the report in another tab. On new print actions, "modelName" key is defined. On older print actions we can get the "modelName" from the editableModel, i.e. XM.Invoice.
Source:

fetch()

Source:
To Do:
  • Document the fetch method.

fetched()

Source:
To Do:
  • Document the fetched method.

filter(Collection, Data, Options)

Filters the result set. Default behavior simply points the filtered collection to the list's regular underlying collection. Apply your custom filtering logic here.
Parameters:
Name Type Description
Collection Object
Data Object
Options options returns Receiver
Source:

findNameInAttr()

If the attribute is equal to or exists as a child attribute, then it is returned.
Source:

formatBoolean(Value) → {String}

Localize a boolean to yes/no text.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatCost(Value) → {String}

Localize a number to cost string in the base currency.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatDate(Date) → {String}

Localize a date.
Parameters:
Name Type Description
Date Date
Inherited From:
Source:
Returns:
Type
String

formatDueDate(Date, View, Model) → {String}

Localize a date and add the class for `error` to the view if the date is before today.
Parameters:
Name Type Description
Date Date
View Object
Model Object
Inherited From:
Source:
Returns:
Type
String

formatExtendedPrice(Value) → {String}

Localize a number to an extended price string in the base currency.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatHours(Value) → {String}

Localize a number to an hours string in the base currency.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatMoney(Value) → {String}

Localize a number to a currency string using the base currency.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatPercent(Value) → {String}

Localize a number to a percent string.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatPurchasePrice(Value) → {String}

Localize a number to a purchase price string in the base currency.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatQuantity(Value) → {String}

Localize a number to a quantity string.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatQuantityPer(Value) → {String}

Localize a number to a quantity string.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatSalesPrice(Value) → {String}

Localize a number to an sales price string in the base currency.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatUnitRatio(Value) → {String}

Localize a number to a unit ratio string.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

formatWeight(Value) → {String}

Localize a number to a weight string.
Parameters:
Name Type Description
Value Number
Inherited From:
Source:
Returns:
Type
String

getCurrentListAttributes()

Returns a list of List Attribute kinds that are currently displayed in the list.
Source:

getDisplayAttributes()

Returns a list of available attributes that can be used for sorting the list or adding as columns.
Source:

getModel()

Source:
To Do:
  • Document the getModel method.

getPlaceholderForAttr(attr) → {String}

Returns a placeholder translation string to be used as a placeholder if one is not specified.
Parameters:
Name Type Description
attr String
Source:
Returns:
Type
String

getSearchableAttributes()

Returns an array of attributes from the model that can be used in a text-based search.
Source:

getWorkspace()

Source:
To Do:
  • Document the getWorkspace method.

itemTap()

Source:
See:
Listens to Events:
  • onItemTap Open up a workspace if the key is tapped, or if 'toggleSelected' is off. Propagate this event only if no workspace is opened.event:

lazyLoad()

Manage lazy loading
Source:

openReport()

Open the report pdf in a new tab
Source:

queryChanged()

Makes sure the collection can handle the sort order defined in the query.
Source:

scroll()

Manages lazy loading of items in the list.
Source:

sendMail()

If the device has email capability, this bring up the default email client with the current address as the "to:" value.
Source:

sendUrl()

Opens a new window with the url provided, appended with a prefix if provided.
Source:

setupItem()

Source:
To Do:
  • Document the etupItem method.