Download the PHP package mkocansey/bladewind-sortable without Composer
On this page you can find all versions of the php package mkocansey/bladewind-sortable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mkocansey/bladewind-sortable
More information about mkocansey/bladewind-sortable
Files in mkocansey/bladewind-sortable
Package bladewind-sortable
Short Description BladewindUI — Drag and drop sortable list component (powered by SortableJS)
License MIT
Informations about the package bladewind-sortable
Sortable
BladewindUI — Drag and drop sortable list component, powered by SortableJS.
Installation
Or install the full library:
Usage
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
type |
simple\|shared |
simple |
shared lists can exchange items with other lists in the same group. |
group |
string | null |
Group name used by shared lists to know which lists can swap items. |
clone |
bool | false |
Leave a copy behind when dragging an item into another (shared) list. |
sortable |
bool | true |
Enable or disable sorting of items within the list. |
hasHandle |
bool | false |
Drag items by a dedicated handle instead of the whole item surface. |
handleIcon |
string | bars-3 |
Heroicon name used for the drag handle when hasHandle is true. |
filter |
string | null |
Space/comma separated class names whose items cannot be dragged. |
multidrag |
bool | false |
Select (ctrl/cmd + click) and drag multiple items at once. |
swap |
bool | false |
Swap items on drop instead of shifting them. Not combinable with multidrag. |
animation |
int | 150 |
Reorder animation duration in milliseconds. |
inputName |
string | null |
Renders a hidden <input> with this name, kept in sync with the order as a JSON array. Submit it with your form. |
onSorted |
string | null |
Name of a JS function called after each reorder as (order, event). Useful for saving via AJAX. |
The sortable.item component accepts a value attribute (rendered as data-id) — this is the identifier reported in the order array, e.g. your model id.
Saving the order
Submitting with a form. Give the list an inputName and each item a value. A hidden input is
kept in sync with the order and submitted like any other field:
On the server the field arrives as a JSON array of ids in their new order:
Saving with AJAX (no form submit). Point onSorted at a JS function that receives the order array:
Reading the order yourself. Each list is exposed as a JS variable named after its name, so you can
call SortableJS methods directly — e.g. task_list.toArray() returns the current order at any time.
Sharing items between two lists
Documentation
Full documentation, live demos, and all available attributes are at bladewindui.com.
License
MIT — see the LICENSE file.
All versions of bladewind-sortable with dependencies
mkocansey/bladewind-core Version ^4.4
mkocansey/bladewind-icon Version ^4.4
mkocansey/bladewind-script Version ^4.4