List controller build on top of component/reactive. Blog post
Install with component(1):
$ component install mikanda/reactive-list
add(index, model, el)
- Fired when an element was added.model
is the model associated with the element.el
is theDOMElement
which was removed.remove(index, model, el)
- Fired when an element was removed.
Initialize the widget.
el
is the container element to usetemplate
is the component/reactive template used to generate the rowsview
is the optional view passed to reactive per default
Insert a new sub-widget. If index
is given replace the element at
index
otherwise insert at index 0. Returns the newly created
DOMElement
. model
is an optional model to bind with reactive.
Append a new sub-widget. If index
is given append after the
element at index
. Returns the newly created DOMElement
.
model
is the same as in .insert()
.
Remove the element at index
. Returns the model stored at index
.
MIT