#[repr(C)]pub struct ListView {
pub columns: StringVec,
pub rows: ListViewRowVec,
pub sorted_by: OptionUsize,
pub scroll_offset: PixelValueNoPercent,
pub content_height: OptionPixelValueNoPercent,
pub column_context_menu: OptionMenu,
pub on_lazy_load_scroll: OptionListViewOnLazyLoadScroll,
pub on_column_click: OptionListViewOnColumnClick,
pub on_row_click: OptionListViewOnRowClick,
}Expand description
List view, optionally able to lazy-load data
Fields§
§columns: StringVecColumn names
rows: ListViewRowVecCurrently rendered rows. Note that the ListView does not have to render all rows at once, usually you’d only render the top 100 rows
sorted_by: OptionUsizeWhich column is the list view sorted by (default = None)?
scroll_offset: PixelValueNoPercentOffset to add to the rows used when layouting row positions during lazy-loaded scrolling. Also affects the scroll position
content_height: OptionPixelValueNoPercentHeight of the content, if not all rows are loaded
Context menu for the columns (usually opens a context menu to select which columns to show)
on_lazy_load_scroll: OptionListViewOnLazyLoadScrollIndicates that this ListView is being lazily loaded, allows control over what happens when the user scrolls the ListView.
on_column_click: OptionListViewOnColumnClickWhat to do when the user left-clicks the column (usually used for storing which column to sort by)
on_row_click: OptionListViewOnRowClickWhat to do when the user left-clicks a row (usually used for selecting the row depending on the state)
Implementations§
Source§impl ListView
impl ListView
pub fn create(columns: StringVec) -> Self
pub fn swap_with_default(&mut self) -> Self
pub fn with_columns(self, columns: StringVec) -> Self
pub fn set_columns(&mut self, columns: StringVec)
pub fn with_rows(self, rows: ListViewRowVec) -> Self
pub fn set_rows(&mut self, rows: ListViewRowVec)
pub fn with_sorted_by(self, sorted_by: OptionUsize) -> Self
pub fn set_sorted_by(&mut self, sorted_by: OptionUsize)
pub fn with_scroll_offset(self, scroll_offset: PixelValueNoPercent) -> Self
pub fn set_scroll_offset(&mut self, scroll_offset: PixelValueNoPercent)
pub fn with_content_height(self, content_height: PixelValueNoPercent) -> Self
pub fn set_content_height(&mut self, content_height: PixelValueNoPercent)
pub fn with_on_column_click<C: Into<ListViewOnColumnClickCallback>>( self, refany: RefAny, on_column_click: C, ) -> Self
pub fn set_on_column_click<C: Into<ListViewOnColumnClickCallback>>( &mut self, refany: RefAny, on_column_click: C, )
pub fn with_on_row_click<C: Into<ListViewOnRowClickCallback>>( self, refany: RefAny, on_row_click: C, ) -> Self
pub fn set_on_row_click<C: Into<ListViewOnRowClickCallback>>( &mut self, refany: RefAny, on_row_click: C, )
pub fn dom(self) -> Dom
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ListView
impl RefUnwindSafe for ListView
impl Send for ListView
impl Sync for ListView
impl Unpin for ListView
impl UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more