pub struct NodeRef<'a, Msg> { /* private fields */ }Expand description
A chainable reference to the node most recently pushed onto a
ContainerBuilder, used to set styling/events without needing a
separate variable per node.
Implementations§
Source§impl<'a, Msg> NodeRef<'a, Msg>
impl<'a, Msg> NodeRef<'a, Msg>
pub fn class(self, class: impl Into<String>) -> Self
pub fn on_click(self, msg: Msg) -> Self
Sourcepub fn on_input(self, f: impl Fn(String) -> Msg + Send + Sync + 'static) -> Self
pub fn on_input(self, f: impl Fn(String) -> Msg + Send + Sync + 'static) -> Self
Two-way binding for Input nodes: f is called with the input’s new
value on every change, producing a Msg to dispatch. See
OnInput. Currently only wired up by tpt-appfront-dom.
Sourcepub fn on_toggle(self, f: impl Fn(bool) -> Msg + Send + Sync + 'static) -> Self
pub fn on_toggle(self, f: impl Fn(bool) -> Msg + Send + Sync + 'static) -> Self
Two-way binding for Checkbox nodes: f is called with the
checkbox’s new checked state on every change. See OnToggle.
pub fn ai_action(self, action: impl Into<String>) -> Self
pub fn ai_param(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn ai_description(self, desc: impl Into<String>) -> Self
Sourcepub fn attr(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn attr(self, name: impl Into<String>, value: impl Into<String>) -> Self
Sets an arbitrary attribute (e.g. role, tabindex, aria-*,
placeholder). Rendered verbatim by backends that model HTML
attributes; ignored where unsupported. See NodeMeta::attrs.
Sourcepub fn aria(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn aria(self, name: impl Into<String>, value: impl Into<String>) -> Self
Convenience for ARIA attributes (e.g. self.aria("label", "menu")
emits aria-label="menu").
Sourcepub fn key(self, key: impl Into<String>) -> Self
pub fn key(self, key: impl Into<String>) -> Self
Stable identity for reconciliation (e.g. a row/entity id) — see
NodeMeta::key.
Sourcepub fn virtual_scroll(self, config: VirtualScroll) -> Self
pub fn virtual_scroll(self, config: VirtualScroll) -> Self
Enables windowed rendering for a List/DataGrid — see
VirtualScroll.