RowSelectionStore

class RowSelectionStore<T, I>(rowIdProvider: (T) -> I) : RootStore<List<T>>

This store manages the selected rows of the data table. It does not manage the state of the columns (configuration meta data like sorting, order and so on); this is done by StateStore!

Constructors

Link copied to clipboard
fun <T, I> RowSelectionStore(rowIdProvider: (T) -> I)

Functions

Link copied to clipboard
open suspend override fun enqueue(update: QueuedUpdate<List<T>>)
Link copied to clipboard
open fun errorHandler(exception: Throwable, oldValue: List<T>): List<T>
Link copied to clipboard
open fun handle(errorHandler: ErrorHandler<List<T>>, execute: suspend (List<T>) -> List<T>): SimpleHandler<Unit>
open fun <A> handle(errorHandler: ErrorHandler<List<T>>, execute: suspend (List<T>, A) -> List<T>): SimpleHandler<A>
Link copied to clipboard
open fun <E> handleAndEmit(errorHandler: ErrorHandler<List<T>>, execute: suspend FlowCollector<E>.(List<T>) -> List<T>): EmittingHandler<Unit, E>
open fun <A, E> handleAndEmit(errorHandler: ErrorHandler<List<T>>, execute: suspend FlowCollector<E>.(List<T>, A) -> List<T>): EmittingHandler<A, E>
Link copied to clipboard
open infix fun <E : Event, X : Element> DomListener<E, X>.handledBy(handler: Handler<Unit>)
open infix fun <E : Event, X : Element> DomListener<E, X>.handledBy(execute: suspend (E) -> Unit): Job
open infix fun <E : Event> WindowListener<E>.handledBy(handler: Handler<Unit>)
open infix fun <E : Event> WindowListener<E>.handledBy(execute: suspend (E) -> Unit): Job
open infix fun <A> Flow<A>.handledBy(handler: Handler<A>)
open infix fun <A> Flow<A>.handledBy(execute: suspend (A) -> Unit): Job
Link copied to clipboard
fun isDataRowSelected(item: T): Flow<Boolean>
Link copied to clipboard
open fun <X> sub(lens: Lens<List<T>, X>): SubStore<List<T>, X>
Link copied to clipboard
open fun syncBy(handler: Handler<Unit>)
open fun syncBy(handler: Handler<List<T>>)
Link copied to clipboard
open fun <I> syncWith(socket: Socket, resource: Resource<List<T>, I>)

Properties

Link copied to clipboard
open override val current: List<T>
Link copied to clipboard
open override val data: Flow<List<T>>
Link copied to clipboard
val dbClickedRow: EmittingHandler<T, T>
Link copied to clipboard
open override val id: String
Link copied to clipboard
open override val job: Job
Link copied to clipboard
open override val path: String
Link copied to clipboard
val selectedData: Flow<List<T>>

The first item must always be dropped; need to find out why!

Link copied to clipboard
val selectRow: SimpleHandler<T?>
Link copied to clipboard
val selectRows: EmittingHandler<T, List<T>>
Link copied to clipboard
val syncHandler: SimpleHandler<List<T>>

This handler can be used to synchronize the selection with the actual data of the table. If some item gets deleted, it should also disappear from the selection.

Link copied to clipboard
open override val update: SimpleHandler<List<T>>
Link copied to clipboard
val updateRow: SimpleHandler<T?>

This handler can be used to preselect one single row for the initial rendering of the table. As the store is made to handle a List of rows as well as a single selection, we need this special Flow for preselecting a single row. For preselecting arbitrary rows, just stick to the default update handler!