Skip to main content

TableViewColumn

Struct TableViewColumn 

Source
pub struct TableViewColumn<T> { /* private fields */ }
Expand description

XAML TableViewColumn: one column of a TableView over items of type T.

Implementations§

Source§

impl<T: 'static> TableViewColumn<T>

Source

pub fn text( app: &mut App, header: impl Into<String>, binding: impl Fn(&T) -> String + 'static, ) -> Ref<Self>

XAML TableViewTextColumn with its Header and Binding: each cell shows the text binding gives for the row’s item, and the column sorts by that text unless given a key of its own.

Source

pub fn template( app: &mut App, header: impl Into<String>, cell_template: impl Fn(&mut App, BuildContext, &T) -> WidgetRef + 'static, ) -> Ref<Self>

XAML TableViewTemplateColumn with its Header and CellTemplate: each cell is what cell_template builds for the row’s item. It sorts only by a key or comparer it is given.

Source

pub fn dispose(self: Handle<Self>, app: &mut App)

Releases the listeners; the column is not used after.

Source

pub fn header(self: Handle<Self>, app: &App) -> &str

Header.

Source

pub fn set_header(self: Handle<Self>, app: &mut App, value: impl Into<String>)

Sets Header.

Source

pub fn header_tool_tip(self: Handle<Self>, app: &App) -> Option<&str>

HeaderToolTip: the header’s tooltip; None or empty shows none.

Source

pub fn set_header_tool_tip( self: Handle<Self>, app: &mut App, value: Option<String>, )

Sets HeaderToolTip.

Source

pub fn width(self: Handle<Self>, app: &App) -> GridLength

Width: pixels, Auto (the widest realized cell) or a star share of the space the fixed columns leave.

Source

pub fn set_width(self: Handle<Self>, app: &mut App, value: GridLength)

Sets Width.

Source

pub fn min_width(self: Handle<Self>, app: &App) -> f64

MinWidth.

Source

pub fn set_min_width(self: Handle<Self>, app: &mut App, value: f64)

Sets MinWidth.

Source

pub fn max_width(self: Handle<Self>, app: &App) -> f64

MaxWidth.

Source

pub fn set_max_width(self: Handle<Self>, app: &mut App, value: f64)

Sets MaxWidth.

Source

pub fn can_resize(self: Handle<Self>, app: &App) -> bool

CanResize: whether this column shows a gripper; the table’s can_user_resize_columns gates them all.

Source

pub fn set_can_resize(self: Handle<Self>, app: &mut App, value: bool)

Sets CanResize.

Source

pub fn actual_width(self: Handle<Self>, app: &App) -> f64

ActualWidth: the width the table last resolved, clamped to MinWidth and MaxWidth. Read-only.

Source

pub fn frozen_edge(self: Handle<Self>, app: &App) -> TableViewFrozenEdge

FrozenEdge.

Source

pub fn set_frozen_edge( self: Handle<Self>, app: &mut App, value: TableViewFrozenEdge, )

Sets FrozenEdge.

Source

pub fn visible(self: Handle<Self>, app: &App) -> bool

Visibility: whether the column and its cells are shown.

Source

pub fn set_visible(self: Handle<Self>, app: &mut App, value: bool)

Sets Visibility.

Source

pub fn can_sort(self: Handle<Self>, app: &App) -> bool

CanSort: whether a header click sorts this column; sorting from code still works.

Source

pub fn set_can_sort(self: Handle<Self>, app: &mut App, value: bool)

Sets CanSort.

Source

pub fn sort_cycle(self: Handle<Self>, app: &App) -> TableViewSortCycle

SortCycle, read when the header is clicked.

Source

pub fn set_sort_cycle( self: Handle<Self>, app: &mut App, value: TableViewSortCycle, )

Sets SortCycle.

Source

pub fn set_sort_key<K: Ord>( self: Handle<Self>, app: &mut App, key: impl Fn(&T) -> K + 'static, )

Sets SortMemberPath, as the key it names: the column sorts its rows by key. A text column without one sorts by its cells’ text.

Source

pub fn set_custom_sort_comparer( self: Handle<Self>, app: &mut App, comparer: impl Fn(&T, &T) -> Ordering + 'static, )

Sets CustomSortComparer, which takes precedence over the sort key. A column sorted at the time is sorted again with it.

Source

pub fn sort_direction(self: Handle<Self>, app: &App) -> SortDirection

SortDirection: None unless the column is part of the active sort. Written by the owning table; read-only.

Trait Implementations§

Source§

impl<T: 'static> ChangeNotifier for TableViewColumn<T>

Source§

fn change_notifier_data(&self) -> &ChangeNotifierData

Source§

fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData

Source§

fn will_add_listener(self: Handle<Self>, app: &mut App)

Runs before the listener is stored. Dart overrides of addListener that work before super.addListener go here.
Source§

fn did_remove_listener(self: Handle<Self>, app: &mut App)

Runs after the listener is removed. Dart overrides of removeListener that work after super.removeListener go here.
Source§

impl<T> Debug for TableViewColumn<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for TableViewColumn<T>

§

impl<T> !Send for TableViewColumn<T>

§

impl<T> !Sync for TableViewColumn<T>

§

impl<T> !UnwindSafe for TableViewColumn<T>

§

impl<T> Forget for TableViewColumn<T>

§

impl<T> Freeze for TableViewColumn<T>
where *const u8 is !null: Freeze, PhantomData<Option<Listener>>: Freeze, *const RcInner<Cell<usize>> is !null: Freeze, PhantomData<RcInner<Cell<usize>>>: Freeze, *const RcInner<dyn Fn(&T) -> String> is !null: Freeze, PhantomData<RcInner<dyn Fn(&T) -> String>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>>>: Freeze, PhantomData<u8>: Freeze, *const RcInner<dyn Fn(&T, &T) -> Ordering> is !null: Freeze, PhantomData<RcInner<dyn Fn(&T, &T) -> Ordering>>: Freeze, NonZero<u32>: Freeze,

§

impl<T> Move for TableViewColumn<T>

§

impl<T> Unpin for TableViewColumn<T>
where *const u8 is !null: Unpin, Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, Rc<Cell<usize>>: Unpin, Rc<dyn Fn(&T) -> String>: Unpin, Rc<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>>: Unpin, Rc<dyn Fn(&T, &T) -> Ordering>: Unpin,

§

impl<T> UnsafeUnpin for TableViewColumn<T>
where *const u8 is !null: UnsafeUnpin, PhantomData<Option<Listener>>: UnsafeUnpin, *const RcInner<Cell<usize>> is !null: UnsafeUnpin, PhantomData<RcInner<Cell<usize>>>: UnsafeUnpin, *const RcInner<dyn Fn(&T) -> String> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&T) -> String>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const RcInner<dyn Fn(&T, &T) -> Ordering> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&T, &T) -> Ordering>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ListenableObject for T
where T: ChangeNotifier,

Source§

fn add_listener(self: Handle<T>, app: &mut App, listener: Listener)

Register a closure to be called when the object notifies its listeners.
Source§

fn remove_listener(self: Handle<T>, app: &mut App, listener: &Listener)

Remove a previously registered closure from the list of closures that the object notifies.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>