LgListView<TItem>
Module : Lagoon.UI
Namespace : Lagoon.UI.Components
Catégorie : ListView
Hérite de : LgAriaComponentBase
List view component.
Paramètres
| Paramètre | Type | Description |
|---|---|---|
ActiveItem | TItem | Gets or sets the active item (two-way binding): its card gets the active class. When bound, a click on a card makes its item active. The items are compared like the selection (see KeyField). |
ActiveItemChanged | EventCallback<TItem> | Gets or sets the event raised when the active item changes (two-way binding of ActiveItem). |
AdditionalAttributes | IReadOnlyDictionary<string, object> | Gets or sets a collection of additional attributes that will be applied to the created element. |
AllowCancellation | bool | Gets or sets a value indicating whether the user can cancel the remote data loading. |
AllowPaging | bool | Gets or sets a value indicating whether the items are paginated. |
BodyContent | RenderFragment<TItem> | Gets or sets the content of the card body (ListViewItemContext{TItem}.RenderBody). The card body displays item.ToString() when it is not set. |
CanDrop | Func<ListViewDropContext<TItem>, bool> | Gets or sets the method indicating if a dragged item can be dropped at a position of this list (target list), called while the item is hovering the position. A refused position displays no insertion line and the item cannot be released there. |
Collapsable | bool | Gets or sets a value indicating whether the list can be collapsed by a click on its header. |
Collapsed | bool | Gets or sets a value indicating whether the list is collapsed (two-way binding). |
CollapsedChanged | EventCallback<bool> | Gets or sets the event raised when the list is collapsed or expanded (two-way binding of Collapsed). |
ColorSelector | Func<TItem, string> | Gets or sets the method returning the CSS color of the stripe of an item's card (ListViewItemContext{TItem}.Color). The stripe is displayed when this method, StripeCssClassSelector or StripeIconSelector returns a value, or when StripeContent is set; without color nor stripe CSS class, it keeps the theme color. |
ConfirmationMessageSelector | Func<TItem, string> | Gets or sets the method returning the message to confirm before the action of a click on an item's card (OnItemClick, active item or link). No confirmation is asked when it returns null or an empty string. |
ControllerQueryArg | object | Gets or sets the additional argument to send to the controller with each data query. |
ControllerUri | string | Gets or sets the URI of the controller providing the items. When set, the data is loaded remotely from the "[Queryable]" endpoint instead of the Items list. |
CssClass | string | Gets or sets the CSS classes. |
CssClassSelector | Func<TItem, string> | Gets or sets the method returning the CSS classes added to an item's default card (ListViewItemContext{TItem}.CssClass in an ItemTemplate). |
CurrentPage | int | Gets or sets the current page index (1 for the first page). |
CurrentPageChanged | EventCallback<int> | Gets or sets the event raised when the current page changes. |
DataErrorTitle | string | Gets or sets the title displayed when the data loading fails. |
DefaultCollapsed | bool? | Gets or sets the initial collapsed state. When defined, it overrides the initial value of Collapsed. |
DefaultGroupCollapsed | bool | Gets or sets if the groups are initially collapsed. (Default is false) |
DefaultPageSize | int? | Gets or sets the initial page size. Must be one of the PaginationSizeSelector values (0 = all the items, when offered by the selector); the first value of the selector otherwise. |
DefaultShowFilters | bool? | Gets or sets a value indicating whether the filter panel is initially visible. When defined, it overrides the initial value of ShowFilters. |
DisplayInputPageSelector | bool | Gets or sets a value indicating whether the pager displays a numeric input to go to a page. |
DragFromItem | bool | Gets or sets if the mouse (or the pen) drags an item from anywhere on it, and not only from its drag handle (DragMode): a press without move still clicks the item, and its fields and controls (links, buttons, inputs, elements with the button role) do not start a drag. The touch keeps the long press on the item and the keyboard keeps the handle. (Default is false) |
DragGroup | string | Gets or sets the name of the group of lists exchanging items (ListViewDragMode.DragOut and ListViewDragMode.DropIn): an item can only be dropped into a list of the same group, with the same item type. Without group, the items can only be reordered inside the list. |
DragMode | ListViewDragMode | Gets or sets the drag and drop capabilities of the list (flags). The items are dragged by a handle displayed on the left of their card (or rendered by ListViewItemContext{TItem}.RenderDragHandle in a custom template), with the mouse, the touch or the keyboard. (Default is ListViewDragMode.None) |
Filters | RenderFragment | Gets or sets the filter declarations (a list of LgListViewFilter{TItem, TValue} components), rendered in a collapsible panel above the list. |
FiltersPosition | ListViewFiltersPosition | Gets or sets the position of the filter panel: above the items, in a centered modal window or in a drawer sliding from the left or the right edge of the screen. (Default is ListViewFiltersPosition.Top) |
GroupCollapsable | bool | Gets or sets if the user can collapse and expand the groups (group header click, "Expand all" / "Collapse all" buttons). When false, the groups are always expanded and DefaultGroupCollapsed is ignored. (Default is true) |
GroupColorSelector | Func<TItem, string> | Gets or sets the method returning the CSS color of the stripe of a group header, called with the first item of the group. No stripe is displayed when it returns null or an empty string. |
GroupHeaderContent | RenderFragment<ListViewGroupContext<TItem>> | Gets or sets the content of a group header. The header displays the group key (ListViewGroupContext{TItem}.Text) and the number of items of the group when it is not set. |
GroupOrderSelector | Expression<Func<TItem, object>> | Gets or sets the order of the groups (e.g. the rank of a status grouped by its label). The groups are sorted by key when it is not set. Ignored without GroupSelector. |
GroupSelector | Expression<Func<TItem, object>> | Gets or sets the group key of an item. When set, the displayed items are grouped by key under a collapsible group header: the list is sorted by group first (by GroupOrderSelector, then by key), then by the selected sort, also on the server side with ControllerUri. With AllowPaging, the groups are those of the current page. |
IconName | string | Gets or sets the name of the icon displayed before the title. |
ItemCopyFactory | Func<TItem, TItem> | Gets or sets the method creating the copy of an item dragged from this list into another one, with ListViewDragMode.Copy (the item itself is inserted into the target list when it is not set). |
ItemMinWidth | string | Gets or sets the minimal width of an item (CSS length, e.g. "18rem"). When set, the items are laid out in a grid filling the available width with as many columns as possible. Ignored when Virtualize is enabled. |
ItemTemplate | RenderFragment<ListViewItemContext<TItem>> | Get or sets the item template (card for example). When set, it controls the whole item rendering; its ListViewItemContext{TItem} exposes the item and the parts of the default card (ListViewItemContext{TItem}.RenderCard, ListViewItemContext{TItem}.RenderStripe, ListViewItemContext{TItem}.RenderBody, ListViewItemContext{TItem}.CssClass) built from the card parameters (BodyContent, StripeContent, the selectors, OnItemClick, ActiveItem). When it is not set, a default card is rendered from these parameters. |
Items | ICollection<TItem> | Gets or sets the local items source. Ignored when ControllerUri is set. |
KeyField | string | Gets or sets the name of the property identifying an item. Selected items are compared on this property, so the selection survives a reload of the items (e.g. a remote page change). When omitted, a remote list (ControllerUri) uses the Id property of the item type when it has one; otherwise, the default equality of the item type is used. The key follows a change of this parameter or of the data source (local / remote). |
Kind | Kind | Gets or sets the kind of the frame wrapping the list. (Default is Kind.Primary) |
LinkSelector | Func<TItem, LgPageLink> | Gets or sets the method returning the page opened by a click on an item's card (LgCard.Link). An item with a link navigates without raising OnItemClick nor changing the active item. |
ListViewDataCounter | ListViewDataCounter | Gets or sets the counters of the loaded data (two-way binding, updated after each data load). |
ListViewDataCounterChanged | EventCallback<ListViewDataCounter> | Gets or sets the event raised when the data counters change (two-way binding of ListViewDataCounter). |
NoDataDescription | string | Gets or sets the description displayed when the data source contains no item. |
NoDataTitle | string | Gets or sets the title displayed when the data source contains no item. |
OnFilterChanged | EventCallback<ListViewFilterChangedEventArgs> | Gets or sets the event raised when the set of active filters changes (including when the filter values are restored from the persisted state). |
OnItemClick | EventCallback<TItem> | Gets or sets the event raised when an item's card is clicked. When set, the cards are clickable. The click first makes the item active when ActiveItem is bound. It is not raised for an item with a link (LinkSelector): the card navigates instead. |
OnItemDrop | EventCallback<ListViewDropEventArgs<TItem>> | Gets or sets the event raised on this list (target list) when an item is released on an accepted position, before the items are updated: set ListViewDropEventArgs{TItem}.Cancel to refuse the drop, or ListViewDropEventArgs{TItem}.Handled when the handler updated the items itself. Required to drop an item into another group of a grouped list (the handler updates the grouped property of the item). |
OnItemDropped | EventCallback<ListViewDropEventArgs<TItem>> | Gets or sets the event raised on this list (target list) once a dropped item is in place: the items are updated and the lists refreshed (e.g. to save the new order). |
OnRowSelection | EventCallback<ListViewSelectionEventArgs<TItem>> | Gets or sets the event raised when the selection changes. |
OnSortChanged | EventCallback<ListViewSortEventArgs> | Gets or sets the event raised when the sort property or the sort direction changes. |
PagerOnTop | bool | Gets or sets a value indicating whether the pager is displayed above the items instead of below. |
PaginationButtonCount | int | Gets or sets the number of page buttons displayed by the pager. |
PaginationSizeSelector | int[] | Gets or sets the available page sizes. Use the value 0 to offer the "all items" choice. |
SelectableRows | bool | Gets or sets a value indicating whether the items are selectable (a checkbox is displayed in front of each item). (Default is false) |
Selection | ICollection<TItem> | Gets or sets the list of selected items. A new list is created when omitted. |
ShowFilters | bool | Gets or sets a value indicating whether the filter panel is visible (two-way binding). Hiding the panel keeps the filter values. |
ShowFiltersChanged | EventCallback<bool> | Gets or sets the event raised when the filter panel visibility changes (two-way binding of ShowFilters). |
ShowFiltersSummary | bool | Gets or sets a value indicating whether the active filters are summed up under the title ("Name : value"), like the grid filters summary, while the filter panel is hidden. (Default is false) |
SortOptions | RenderFragment | Gets or set the sortable field declarations (a list of LgListViewSort{TItem} components). The initial sort is the declaration with IsDefault="true"; the list is not sorted initially when there is none. |
StateId | string | Gets or sets the identifier used to persist the list state (sort, page size, filter values, filter panel visibility) in the browser local storage. The state is not persisted when omitted. |
StripeContent | RenderFragment<TItem> | Gets or sets the content rendered inside the stripe of the card (ListViewItemContext{TItem}.RenderStripe). When it is set, every item has a stripe, of the theme color unless ColorSelector or StripeCssClassSelector returns a value. |
StripeCssClassSelector | Func<TItem, string> | Gets or sets the method returning the CSS classes of the stripe of an item's card (a theme class setting its color for example). The stripe is displayed when this method, ColorSelector or StripeIconSelector returns a value, or when StripeContent is set. |
StripeIconSelector | Func<TItem, string> | Gets or sets the method returning the name of the icon displayed in the stripe of an item's card. An icon displays the stripe, of the theme color unless ColorSelector or StripeCssClassSelector returns a value. |
Title | string | Gets or sets the view title. The counters of the last loaded data, like in the grid title, replace {0} (total number of items) and {1} (number of items of the page); a counter is displayed as ... while unknown (before the first load, and for {1} when the page is empty). |
TitleContent | RenderFragment | Gets or sets the content rendered after the title in the frame header. |
Toolbar | RenderFragment | Gets or sets the toolbar (top) |
ToolbarSelection | RenderFragment | Gets or sets the selection toolbar (bottom) |
TooltipIsHtml | bool | Gets or sets if the tooltips returned by TooltipSelector use the HTML format; else, they use a raw text format. (Default is false) |
TooltipSelector | Func<TItem, string> | Gets or sets the method returning the tooltip of an item's card. |
Virtualize | bool | Gets or sets a value indicating whether the rendering of the items is virtualized (only the visible items are rendered). With AllowPaging, the items of the current page are virtualized. |
VirtualizeItemSize | float | Gets or sets the expected height, in pixels, of an item when the rendering is virtualized. |
Paramètres hérités de LgAriaComponentBase
| Paramètre | Type | Description |
|---|---|---|
AriaLabel | string | Gets or sets aria label |
AriaLabelledBy | string | Gets or sets id of component for aria label |