OptionalclassOptionalclassOptionalexpandedThe set of nodes that are currently expanded. If provided, this should be a
MobX observable.set rather than a plain Set
OptionalgetLists in React require a key prop. This function is called to get that key.
If this is omitted, the index is used as the key. NOTE: in React 18 it is
documented that "Non-unique keys may cause children to be duplicated and/or
omitted" and duplicate list items have been observed in this context when there
are duplicate keys. If you cannot guarantee unique keys, it is better not to
provide getKey at all (but this can cause its own problems, e.g. items losing
focus when the list order changes).
OptionalgetIf the items are stored in wrappers that can change between renders,
provide this function to get a subobject or id of the item that does
not change between renders. These "sel keys" are used in selection
(and in expandedParents in the related TreeList component).
OptionalindentNumber of pixels to indent per level of nesting (default: the theme's treeIndent,
i.e. the --dtbl-indent CSS variable, which itself defaults to 20)
Optionalitemprops that should apply to each item (usually Styles: className and style).
If RenderItem is provided, these props are forwarded to it. In a <DataTable>,
any styles in this object are applied to the row as a whole, not to each cell.
OptionallastThe most recently clicked item
OptionalplaceholderContent to display when the list is empty. If this is a string, it's "grayed out"
using opacity: 0.5.
OptionalreadIf true, the whole list is read-only. If undefined, useIsReadOnlyContext
is used to decide whether the whole list is read-only.
OptionalRenderComponent type used to render the entire row (including an outer div or tr).
OptionalroleOptionalselectionThis is the set of selected items. If not provided, items can still be
selected but the selection state is internal to the list.
If the caller wishes to re-render on changes to the set of selected
items, it can use a MobX observable(set) rather than a plain Set<K>.
ListCore uses runInAction just in case it's an ObservableSet.
If type K isn't the same as T, you must provide a getSelKey prop.
OptionalselWhether to support selecting multiple things (default: no). 'noCtrl' mode is a multiselect mode in which each click is treated as if the Ctrl key (⌘ on Mac) is pressed; if it is actually pressed then a single item is selected and the rest of the selection is cleared.
'noSelect' mode prevents the selection from being changed by the user, so if the app itself does not select anything, nothing can be selected.
OptionalstyleOptionaluseOptionalvirtualCalled when virtualization is enabled to render a placeholder element for a
virtualized gap. Set the gap element's ref prop to the ref parameter; the list uses
the ref to observe the gap so it can become real when it nears the viewport.
OptionalvirtualizeThese settings enable virtualization, which speeds up list rendering by not rendering off-screen items.
OptionalfilterOptionalonOptionalrenderOptionalrenderCalled to render the indentation and tree expander button. It will return an
element with display: inline-block and with a width that varies according to the
appropriate amount of indentation. Note: this should usually be placed inside
a flex row (display: flex) so that word-wrapping of the label after the indent
looks right.
OptionalsortIf provided, this is called after filtering to sort visible items at each level of the tree.
Note: when sort or sortComparer is used in DataTable or DataTableCore, they
stop being used to sort if the user sorts by clicking a column header, or if the
DataTableCoreProps.columnsToSortBy prop is provided. However, these props still
control the default sort order. When a table has a default sort order, the user can
click the same column header three times to cancel user-defined sorting and return
to the default sort order.
OptionalsortThis prop is ignored if sort is provided. Otherwise, if provided, this is used
after filtering to sort only the visible items.
Note: rows are sorted level-by-level. For example, given this tree of items:
Clothes Shirt Pants Shorts Toys Dolls Cars
The three sublists [Clothes, Toys], [Shirt, Pants, Shorts], and [Dolls, Cars] are sorted separately, as one would expect.
The rest of
TreeListCoreProps.