pub trait EditPolicy: 'static {
// Required methods
fn on_blur(&self, context: &EditPolicyContext<'_>) -> EditEnd;
fn on_value_change(&self, context: &EditPolicyContext<'_>) -> DraftAction;
fn on_hidden(&self, context: &EditPolicyContext<'_>) -> EditEnd;
// Provided methods
fn commit_unchanged(&self) -> bool { ... }
fn settle_timeout(&self) -> Duration { ... }
fn error_mark_timeout(&self) -> Option<Duration> { ... }
}Expand description
How an edit session behaves around its commit and under live data. Asked once per event on the UI thread.
The default is StandardEditPolicy.
Required Methods§
Sourcefn on_blur(&self, context: &EditPolicyContext<'_>) -> EditEnd
fn on_blur(&self, context: &EditPolicyContext<'_>) -> EditEnd
The focus left an open editor, or a press landed outside it.
Sourcefn on_value_change(&self, context: &EditPolicyContext<'_>) -> DraftAction
fn on_value_change(&self, context: &EditPolicyContext<'_>) -> DraftAction
The edited cell’s value changed in the store.
The edited row left the shown lines without a user action: a filter, a collapsed group.
Provided Methods§
Sourcefn commit_unchanged(&self) -> bool
fn commit_unchanged(&self) -> bool
Returns true if a commit equal to the value the edit started from
still emits EditCommit. Default: no, the editor closes with
EditCancel { reason: Unchanged }.
Sourcefn settle_timeout(&self) -> Duration
fn settle_timeout(&self) -> Duration
How long an accepted value is shown while the store does not have it yet. Default: 5 s.
Sourcefn error_mark_timeout(&self) -> Option<Duration>
fn error_mark_timeout(&self) -> Option<Duration>
How long the error mark of a failed commit stays; None (the
default): until the cell is edited again or
LiveGridState::clear_edit_error.