SortableListController

SortableListController

Sortable List Controller - Drag and Drop Reordering

Provides drag-and-drop reordering functionality for list items. Emits a custom event when items are reordered so parent controllers can respond to changes.

Usage:

  • Item 1
  • Item 2

Events:

  • sortable-list:reordered - Dispatched when order changes detail: { order: ['id1', 'id2', 'id3'], items: [...DOMElements] }

Constructor

new SortableListController()

Source:

Methods

dragEnd()

Description:
  • Handle drag end - cleanup

Source:

dragEnter()

Description:
  • Handle drag enter - visual feedback

Source:

dragLeave()

Description:
  • Handle drag leave - remove visual feedback

Source:

dragOver()

Description:
  • Handle drag over - allow drop by preventing default

Source:

dragStart()

Description:
  • Handle drag start - store reference to dragged element

Source:

drop()

Description:
  • Handle drop - reorder items

Source:

emitReorderedEvent()

Description:
  • Emit custom event with new order

Source:

getOrder()

Description:
  • Get current order of items

Source: