pub struct ListView { /* private fields */ }Expand description
The records of an entity in a grid: search, filters, sorting and export come with it. Opening a row opens its form.
Implementations§
Source§impl ListView
impl ListView
Sourcepub fn new(session: Session, frame: Frame, view: ViewInfo) -> Self
pub fn new(session: Session, frame: Frame, view: ViewInfo) -> Self
The list of this view in the model, reading through this frame.
Sourcepub fn compact(self) -> Self
pub fn compact(self) -> Self
Only the rows and their headers, as tall as they need, for a few records beside a form.
Sourcepub fn row_action(self, action: GridRowAction) -> Self
pub fn row_action(self, action: GridRowAction) -> Self
A button at the end of every row.
Sourcepub fn cell_text(self, text: CellText) -> Self
pub fn cell_text(self, text: CellText) -> Self
Says what a cell shows, when its value alone is not it.
Sourcepub fn on_open(self, handler: OpenHandler) -> Self
pub fn on_open(self, handler: OpenHandler) -> Self
What opening a row does, with its key. Its form by default.
Sourcepub fn filter(self, filter: Option<Criteria>) -> Self
pub fn filter(self, filter: Option<Criteria>) -> Self
Shows only the records that meet this, besides what the way picked to see the list asks.
Sourcepub fn sort(self, field: impl Into<String>, ascending: bool) -> Self
pub fn sort(self, field: impl Into<String>, ascending: bool) -> Self
Orders the records by this field, after what was already asked for.
Sourcepub fn column_shape(
self,
shape: impl Fn(&FieldInfo, GridColumn) -> GridColumn + 'static,
) -> Self
pub fn column_shape( self, shape: impl Fn(&FieldInfo, GridColumn) -> GridColumn + 'static, ) -> Self
Changes the column of a field: a template, a width, a summary, or one of its own.
Sourcepub fn implied(self, field: impl Into<String>) -> Self
pub fn implied(self, field: impl Into<String>) -> Self
Leaves out the column of this field, whose value is the same on every row.
Sourcepub fn grid_shape(self, shape: impl Fn(DataGrid) -> DataGrid + 'static) -> Self
pub fn grid_shape(self, shape: impl Fn(DataGrid) -> DataGrid + 'static) -> Self
Changes the grid before it goes on the screen, for what the list has no word for.
Sourcepub fn single_selection(self) -> Self
pub fn single_selection(self) -> Self
Only one row selected at a time.
Sourcepub fn plain_toolbar(self) -> Self
pub fn plain_toolbar(self) -> Self
Leaves out the filter builder and exporting to files, for a screen that has its own.
Sourcepub fn remote(self) -> Self
pub fn remote(self) -> Self
Brings rows from storage as they are needed, for lists too long to read at once. Grouping needs the rows at hand, so it is off, and searching covers only fields with text.
Sourcepub fn source(self, source: ListSource) -> Self
pub fn source(self, source: ListSource) -> Self
Reads its records from this and not from storage, for what no storage keeps.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ListView
impl !Send for ListView
impl !Sync for ListView
impl !UnwindSafe for ListView
impl Freeze for ListView
impl Unpin for ListView
impl UnsafeUnpin for ListView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
None keeps the content size.