Undocumented

Hierarchy (view full)

Constructors

Properties

Methods

Events

Constructors

Properties

asJSON: string

Gets the object as serialized JSON string. Or sets serialized JSON (to fill this object's metadata by the metadata included within the JSON)

autoSort: boolean

Undocumented

autoSortDisabled: boolean

Undocumented

autoSortString: string

Undocumented

autoUpdateDisabled: boolean

Undocumented

count: number

Total count of items in list.

deleted: boolean

Set to true after deletion so that 'change' event is called and item is removed from UI lists.

disableAlbumTracksLimit: boolean

Undocumented

dontNotify: boolean

Undocumented

firstSelected: ListItem

Returns first selected item (if any item is selected). Added in 5.0.4

Returns

focusedIndex: number

Index of focused item in the list.

focusedItem: ListItem

Gets focused item in the list.

globalModifyWatch: boolean

Undocumented

groupName: string

Undocumented

id: number

Gets integer id of the object

isLoaded: boolean

Undocumented

isObservable: boolean

Whether this object can be listened (e.g. for 'change' event)

isStatusBarSource: boolean

Is source for status bar informations.

itemsSelected: number

Undocumented

objectType: string

Gets the object type as string

persistentID: string

Gets persistent id of the object

sortedWatch: boolean

Undocumented

statusInfo: Promise<any>

Undocumented

title: string

Gets the object title

Methods

  • Parameters

    Returns number

    Undocumented

  • Add list of items to the list and preserve flags from the source list.

    Parameters

    Returns void

  • Return true when any item is checked

    Returns boolean

  • Asynchronous copy of JS objects to list items. As example check musicBrainz script.

    Parameters

    • totalCount: number
    • callback: any

      to fill one item (with parameters: int, item)

    Returns Promise<any>

  • Return status of the updates. True when auto-updates are suspended by suspendUpdates method.

    Returns boolean

  • Lock object to update state. Events are not called when in update state.

    Returns void

  • Updates the object every X ms when called periodically. Useful e.g. when filling lists. Can be used only in the update lock! (i.e. between beginUpdate/endUpdate)

    Parameters

    • interval: number

    Returns void

  • Clear list (remove all items).

    Returns void

  • Returns Promise<any>

    Undocumented

  • Copies selection from one list to another. Returns a promise which is fulfilled with the index of the first selected item when it's all done.

    Parameters

    Returns Promise<any>

  • Parameters

    • aComparer: any

    Returns void

    Undocumented

  • Delete item at specified index.

    Parameters

    • index: number

      Index of a item to be removed

    Returns void

  • Removes selected items from the list

    Returns number

  • Parameters

    Returns Promise<any>

    Undocumented

  • Unlock object from update state. beginUpdate and endUpdate must be in pair. When endUpdate is called, change event is called.

    Returns boolean

  • Browse all items and send them one by one in defined callback. Note that the items for the callback method are prepared using SharedList.getFastObject, i.e. the performance is good, but you should only use them in the callback method and don't preserve them for later use.

    Parameters

    • cbk: ((item, index) => void)
        • (item, index): void
        • Parameters

          Returns void

    Returns void

    Example

    list.forEach(function(item) {
    // Process the item
    })
  • Return true when all items are checked

    Returns boolean

  • Gets an array of all values of the specified property key. This is faster than getFastObject if you need to retrieve only one or two property values (instead of the entire object). [ADDED IN VERSION 5.0.2]

    Parameters

    • Rest ...params: any[]

    Returns any

  • Gets class name of the object.

    Returns string

  • Gets fast access to item at specified index. Note that this call always returns the same JS object, just modifies the internals so that properties/methods work on different data. It means, that you shouldn't preserve this object for later use, because it would be modified and the result would be unexpected.

    Parameters

    • index: number

      Index of the item

    • obj: any

    Returns any

  • Parameters

    • groupid: string

    Returns any

    Undocumented

  • Parameters

    • groupid: string

    Returns number

    Since

    5.0.1

  • Returns string

    Undocumented

  • Parameters

    • value: string
    • startIndex: number
    • reverseOrder: boolean

    Returns number

    Undocumented

  • Parameters

    • Rest ...params: any[]

    Returns any

    Undocumented

  • Parameters

    • Rest ...params: any[]

    Returns any

    Undocumented

  • Returns a list of all selected items.

    Returns this

  • Returns true, if all is selected in the list.

    Returns boolean

  • Returns true, if something is selected in the list.

    Returns boolean

  • Gets index of a item in list.

    Parameters

    Returns number

  • Get position of the item identified by persistent ID.

    Parameters

    • persistentID: string

    Returns Promise<any>

  • Inserts a new item to a specified position in the list.

    Parameters

    • position: number

      The desired position in the list

    • data: ListItem

      Object to be added in list

    Returns number

  • Inserts list of items to the list at specified position.

    Parameters

    Returns void

  • Gets item at specified index is checked.

    Parameters

    • index: number

      Index of the item

    Returns boolean

  • Parameters

    • itemCallback: any

    Returns boolean

    Undocumented

  • Parameters

    • id: number

    Returns boolean

    Undocumented

  • Parameters

    • Rest ...params: any[]

    Returns Promise<any>

    Undocumented

  • Gets item at specified index is selected.

    Parameters

    • index: number

      Index of the item

    Returns boolean

  • Call defined method with locked data so user can access them.

    Parameters

    • func: (() => any)

      Method to call

        • (): any
        • Returns any

    Returns void

  • Call defined method with the list locked for modifications. It tries to perform the callback immediatelly, but in case there's already a write lock on the list, it performs the callback later.

    Parameters

    • Rest ...params: any[]

    Returns Promise<any>

  • Move selected items to new position.

    Parameters

    • newIndex: number

      New index where to move selected items

    Returns void

  • Notifies that the object was changed (e.g. to force visual update etc.)

    Parameters

    • Rest ...params: any[]

    Returns void

  • Notifies list was loaded and whenLoaded promise can be fulfilled.

    Returns void

  • Parameters

    • Rest ...params: any[]

    Returns Promise<any>

    Undocumented

  • Delete item from list.

    Parameters

    • data: ListItem

      Object to be removed from list

    Returns number

  • Delete item from list asynchronously.

    Parameters

    • data: ListItem

      Object to be removed from list

    Returns Promise<any>

  • Resume auto updates and run auto update immediatelly when any update is pending.

    Returns boolean

  • Select items in range.

    Parameters

    • fromIndex: number

      Start index

    • toIndex: number

      End index

    • select: boolean

      Whether to select or unselect

    Returns void

  • Select items in range, asynchronously.

    Parameters

    • Rest ...params: any[]

    Returns Promise<any>

  • Set all items to (un)checked state

    Parameters

    • state: boolean

      Check state

    Returns void

  • Parameters

    • newState: boolean

    Returns void

    Undocumented

  • Sets checked flag to item in specified index.

    Parameters

    • index: number

      Index of the item

    • value: boolean

      True when checked

    Returns void

  • Parameters

    • groupid: string
    • newState: boolean

    Returns void

    Undocumented

  • Parameters

    • groupid: string
    • rowGroupDimension: number
    • colGroupDimension: number

    Returns void

    Undocumented

  • Parameters

    • rowGroupDimension: number
    • colGroupDimension: number

    Returns void

    Undocumented

  • Parameters

    • value: boolean

    Returns void

    Undocumented

  • Parameters

    • id: number
    • value: boolean

    Returns void

    Undocumented

  • Sets selected flag to item in specified index.

    Parameters

    • index: number

      Index of the item

    • value: boolean

      True when selected

    Returns void

  • SYNCHRONOUSLY sorts the list with the given sorting rule and disables auto-sort.

    To specify sort direction, append ' ASC' or ' DESC' to the tag name and separate them by semicolons.

    Fields are NOT case sensitive (e.g. 'artist', 'Artist', and 'ArTiSt') are all valid, but sort direction IS case sensitive ('ASC' and 'DESC' are valid; 'asc' and 'desc' are not)

    Valid examples:

    list.setSortRule('title');
    list.setSortRule('artist; title');
    list.setSortRule('rating DESC; title ASC');
    list.setSortRule('Rating DESC; TITLE;');

    Invalid examples:

    list.setSortRule('tagThatDoesNotExist');
    list.setSortRule('rating desc; title asc');

    Parameters

    • Value: string

    Returns boolean

  • Sets object at specified index in the list. List needs to be locked before use (see SharedBase.locked).

    Parameters

    • index: number

      Index where to be added

    • value: ListItem

      Object to be added

    Returns void

  • Returns void

    Undocumented

  • Returns void

    Undocumented

  • Returns string

    Undocumented

  • Returns string

    Undocumented

  • Add list of items to the list, but clears the old values. i.e. is the same as calling clear+addList

    Parameters

    Returns void

Events

event_beforeSort: (() => void)

Event is called before list sort begins

See App.listen

Type declaration

    • (): void
    • Returns void

event_change: ((changeType, ...additionalArgs) => void)

Event is called when object is somehow changed

See App.listen

Type declaration

    • (changeType, ...additionalArgs): void
    • Parameters

      • changeType: string

        additional change type (can have values like 'tracklist', 'deleted', 'title' or undefined)

      • Rest ...additionalArgs: any[]

      Returns void

Example

app.listen(object, 'change', (changeType) => {  });
event_destroying: (() => void)

Event is called when object is going to destroy

See App.listen

Type declaration

    • (): void
    • Returns void

event_focuschange: ((newIdx, oldIdx) => void)

Event is called when focused item is changed

See App.listen

Type declaration

    • (newIdx, oldIdx): void
    • Parameters

      • newIdx: number

        new focused item index

      • oldIdx: number

        old focused index

      Returns void

event_loaded: (() => void)

Event is called when list is notified as loaded

See App.listen

Type declaration

    • (): void
    • Returns void

event_sorted: (() => void)

Event is called when list sort is finished

See App.listen

Type declaration

    • (): void
    • Returns void

event_statuschange: (() => void)

Event is called when status info of the object is changed

See App.listen

Type declaration

    • (): void
    • Returns void