pub trait ColumnMovePolicy: 'static {
// Required methods
fn is_allowed(
&self,
context: &ColumnMoveContext<'_>,
block: Range<usize>,
gap: usize,
) -> bool;
fn zone_block(
&self,
context: &ColumnMoveContext<'_>,
column: ColumnIx,
) -> Range<usize>;
// Provided method
fn normalize(&self, _order: &mut ColumnOrder<'_>) { ... }
}Expand description
Decides which columns move together and where they may go, for header
drags, move_column, move_band, zone changes and the move Actions.
The default is BandedMove: a ColumnBand stays
together, as in DevExpress, Syncfusion, Kendo and Infragistics.
FreeMove lets a column leave its band, as AG Grid does.
Required Methods§
Sourcefn is_allowed(
&self,
context: &ColumnMoveContext<'_>,
block: Range<usize>,
gap: usize,
) -> bool
fn is_allowed( &self, context: &ColumnMoveContext<'_>, block: Range<usize>, gap: usize, ) -> bool
Whether block (a range of context.columns()) may be inserted at
gap (0..=columns().len(), counted before the block is removed).
Sourcefn zone_block(
&self,
context: &ColumnMoveContext<'_>,
column: ColumnIx,
) -> Range<usize>
fn zone_block( &self, context: &ColumnMoveContext<'_>, column: ColumnIx, ) -> Range<usize>
The columns that change zone together with column: a range of
context.columns() that contains it.
Provided Methods§
Sourcefn normalize(&self, _order: &mut ColumnOrder<'_>)
fn normalize(&self, _order: &mut ColumnOrder<'_>)
Restores the policy’s invariants after the schema is built or a layout is restored. Stable: a valid order stays as it is.