Class: Collection

ol.ext.input. Collection

A list element synchronize with a Collection. Element in the list can be reordered interactively and the associated Collection is kept up to date.


new Collection(options)

Parameters:
Name Type Description
options *
Properties
Name Type Argument Description
target Element <optional>
collection Collection <optional>

the collection to display in the list

getTitle function <optional>

a function that takes a collection item and returns an Element or a string

Fires:
  • item:select
  • item:dblclick
  • item:order

Extends

  • ol.Object

Methods


getSelect()

Get current selection

Returns:
Type
*

getSelectPosition()

Get current selection

Returns:
Type
number

refresh()

Redraw the list


removeCollection()

Remove current collection (listeners) /!\ remove collection when input list is removed from the DOM


select(item)

Select an item

Parameters:
Name Type Description
item *

selectAt(n)

Select an item at

Parameters:
Name Type Description
n number

setCollection(collection)

Set the collection

Parameters:
Name Type Description
collection ol.Collection