Skip to main content

ReorderPolicy

Trait ReorderPolicy 

Source
pub trait ReorderPolicy: 'static {
    // Required method
    fn decide(&self, context: &ReorderContext) -> ReorderDecision;
}
Expand description

Decides when a new display order replaces the shown one, so rows do not jump under the user’s pointer more than the application wants.

The default is LiveReorder, the industry standard, as in AG Grid and DevExpress; HoldReorder and ManualReorder are the built-in alternatives. All three hold the order while the context menu or a cell editor is open (ReorderContext::is_menu_open, ReorderContext::is_editing), unless the new order comes from a user action. None holds it for commits that wait (ReorderContext::has_pending_edits): a policy of the application may.

Required Methods§

Source

fn decide(&self, context: &ReorderContext) -> ReorderDecision

Called when a new order is ready, when the pointer leaves the grid, when the context menu or a cell editor closes, and when a ReorderDecision::HoldUntil deadline passes.

Implementors§