- create_view and remove_view are default functions called when adding or removing views
- create_view takes a model and returns a view or a promise for a view for that model
- remove_view takes a view and destroys it (including calling `view.remove()`)
- each time the update() function is called with a new list, the create and remove callbacks will be called in an order so that if you append the views created in the create callback and remove the views in the remove callback, you will duplicate the order of the list.
- the remove callback defaults to just removing the view (e.g., pass in null for the second parameter)
- the context defaults to the created ViewList. If you pass another context, the create and remove will be called in that context.

### Hierarchy

- ViewList

## Index

### Constructors

- constructor

### Properties

- _create_view
- _handler_context
- _models
- _remove_view
- views

### Methods

- initialize
- remove
- update

## Constructors

### constructor

- new ViewList(create_view: any, remove_view: any, context: any): ViewList

- - Defined in widget.ts:532

  #### Parameters

  - ##### create_view: any

  - ##### remove_view: any

  - ##### context: any

  #### Returns ViewList

## Properties

### _create_view

_create_view: Function

- Defined in widget.ts:599

### _handler_context

_handler_context: any

- Defined in widget.ts:596

### _models

_models: any[]

- Defined in widget.ts:597

### _remove_view

_remove_view: Function

- Defined in widget.ts:600

### views

views: any[]

- Defined in widget.ts:598

## Methods

### initialize

- initialize(create_view: any, remove_view: any, context: any): void

- - Defined in widget.ts:537

  #### Parameters

  - ##### create_view: any

  - ##### remove_view: any

  - ##### context: any

  #### Returns void

### remove

- remove(): any

- - Defined in widget.ts:585

  removes every view in the list; convenience function for `.update([])` that should be faster returns a promise that resolves after this removal is done

  #### Returns any

### update

- update(new_models: any, create_view: any, remove_view: any, context: any): void

- - Defined in widget.ts:552

  the create_view, remove_view, and context arguments override the defaults specified when the list is created. after this function, the .views attribute is a list of promises for views if you want to perform some action on the list of views, do something like `Promise.all(myviewlist.views).then(function(views) {...});`

  #### Parameters

  - ##### new_models: any

  - ##### create_view: any

  - ##### remove_view: any

  - ##### context: any

  #### Returns void

Generated using TypeDoc