Skip to content
IzzyBlazor 0.1.0-alpha.20

Enter all results ↑ ↓ move Esc close

Reordering

Since 0.1.0-alpha.20
Users reorder items by dragging or from the keyboard, and the list posts or binds the new order.

The members for reordering, and the types they use. Every member of IzzyBlazor.ListView<TItem> is on the ListView API.

Properties (8)

Reorderablebool = falseAdded in 0.1.0-alpha.20

Lets the user reorder the items: each gets a handle to drag, which also opens a menu (Move up, Move down, Move to top, Move to bottom) for moving without dragging; with DragWholeItem and an ItemMenu, the moves go in each item's ⋯ menu instead, and the item drags from anywhere. Needs an ItemKey and every item shown: no paging and no ItemsProvider. On interactive pages bind the order with @bind-Items; on static pages give it a Name inside a form and pass the posted ListOrder back as Order.

Namestring?Added in 0.1.0-alpha.20

For a Reorderable list on a static page, the prefix of the fields it posts: {Name}.Keys and {Name}.Move, bound as a ListOrder. Without it, a static page shows no handles.

OrderListOrder?Added in 0.1.0-alpha.20

For a Reorderable list on a static page, what the form posted: the list shows the posted order with the move applied, and focuses the moved item's handle (or ⋯ button).

SubmitOnMovebool = falseAdded in 0.1.0-alpha.20Static only

For a Reorderable list on a static page with script, posts the form after each move, for pages that save every move. Otherwise moves stay in the page until the form is submitted. With JavaScript off, each move from an item's menu posts anyway.

DragWholeItembool = falseAdded in 0.1.0-alpha.20

For a Reorderable list, lets a drag start anywhere on an item, not only on its handle: with a mouse after a small move, on touch after a long press (so a swipe still scrolls the page). Links, buttons and fields in the item keep their presses; the item's own link (ItemHref) or button (OnItemClick) still works on a click. With an ItemMenu there are no handles: each item's ⋯ menu ends with a Move submenu (Move up, Move down, Move to top, Move to bottom); without one, the handle stays as the menu of moves.

Without JavaScript: Nothing drags; with an ItemMenu, the moves in each item's ⋯ menu post the form.

Zonestring?Added in 0.1.0-alpha.20

Makes the list a zone of the DropZoneGroup<T> around it: it shows the group's items whose zone is this one, and items move here from the group's other zones. Name each zone with AriaLabel, which also names it in the menu of moves.

AcceptsFunc<TItem, bool>?Added in 0.1.0-alpha.20

For a Zone, which items may move here from other zones, such as t => t.Reviewed.

MaxItemsint?Added in 0.1.0-alpha.20

For a Zone, how many items it holds at most; a full zone takes no more from the others.

Events (1)

OnMoveEventCallback<ListMoveEventArgs<TItem>>Added in 0.1.0-alpha.20Interactive only

Runs before a move changes the list, on interactive pages: save it here, or set Cancel to keep the item where it was. A dragged item stays where it was dropped while this runs, for up to 3 seconds; moves made meanwhile are ignored.

Types (2)

ListMoveEventArgs

class

A move in a reorderable ListView or between drop zones, before the list changes.

ListMoveEventArgs members
MemberDescription
Item TItem

The item that moves.

Key string

Its key.

FromIndex int = 0

Its place before the move, from 0, among the items of its zone (or the list).

ToIndex int = 0

Its place after the move, from 0, among the items of the zone it moves to (or the list).

FromZone string?

The zone it moves from; null outside a DropZoneGroup.

ToZone string?

The zone it moves to; null outside a DropZoneGroup.

Cancel bool = false

Set to keep the item where it was, such as when saving the move failed.

ListOrder

class

What a reorderable ListView or a DropZoneGroup posts on a static page: its keys in the order shown (and in a group each item's zone), and the move a menu asked for. Bind it with [SupplyParameterFromForm(FormName = "...", Name = "...")] under the list's (or group's) Name, pass it back as Order so it shows the new order, and save Arrange (or, for zones, Arrange) when the post is the form's own submit (Move is null).

ListOrder members
MemberDescription
Keys string[]?

The items' keys, in the order the list showed them (after any moves made with script).

Zones string[]?

In a group of zones, each item's zone, in the same order as Keys.

Move string?

The move a handle's menu posted, such as up:42; null when the form's own submit posted.

Arrange<TItem>(IReadOnlyList<TItem> items, Func<TItem, string> key)
Arrange<TItem>(IReadOnlyList<TItem> items, Func<TItem, string> key, Func<TItem, string> zoneOf)
ZoneOf(string key)

The zone the post put an item in (its posted zone, or the move's), or null when the post didn't name it.

Connection lost

Rejoining the server…