Getting started with nxt-sortablejs

Installing


Import Sortablejs module


If you want to cofigure global Sortablejs options, include SortablejsModule.forRoot in your application.


Use it in a template


Configuration options

InputTypeDefault valueDescription
[nxtSortablejs]SortableData<T>undefined

Input data, can be Array or FormArray

[sortablejsContainer]stringundefined

CSS selector for the sortable container

Mostly required when used with custom components which wrap items in multiple containers. In that case, this should be the selector for the direct HTML parent of sortable items.

[config]Optionsundefined

Sortablejs configuration

[cloneFunction]CloneFunction<T>undefined

A function invoked when cloning items from template dataset into target dataset

OutputTypeDescription
(init)Sortable

Initialised a new Sortablejs instance