datagrid
- class trame.widgets.datagrid.VGrid(children=None, **kwargs)
Bases:
AbstractElement
Spreadsheet like component Properties
- Parameters:
auto_size_column – Autosize config Enable columns autoSize, for more details check @autoSizeColumn plugin By default disabled, hence operation is not resource efficient true to enable with default params (double header separator click for autosize) or provide config boolean | { mode?: ColumnAutoSizeMode; allColumns?: boolean; letterBlockSize?: number; preciseSize?: boolean; } false
can_focus – When true cell focus appear. boolean true
col_size – Indicates default column size. number 100
column_types – Types Every type represent multiple column properties Types will be merged but can be replaced with column properties { [name: string]: ColumnType; } {}
columns – Columns - defines an array of grid columns. Can be column or grouped column. (ColumnRegular | ColumnGrouping)[] []
editors – Custom editors register { [name: string]: EditorCtr; } {}
exporting – Enables export plugin Can be boolean Can be export options boolean false
filter – Enables filter plugin Can be boolean Can be filter collection boolean | { collection?: Record<ColumnProp, FilterCollectionItem>; include?: string[]; customFilters?: Record<string, CustomFilter>; } false
frame_size – Defines how many rows/columns should be rendered outside visible area. number 1
grouping – Group models by provided properties Define properties to be groped by { props?: ColumnProp[]; expandedAll?: boolean; } undefined
pinned_bottom_source – Pinned bottom Source: {[T in ColumnProp]: any} - defines pinned bottom rows data source. DataType[] []
pinned_top_source – Pinned top Source: {[T in ColumnProp]: any} - defines pinned top rows data source. DataType[] []
plugins – Custom grid plugins Has to be predefined during first grid init Every plugin should be inherited from BasePlugin (typeof Plugin)[] undefined
range – When true, user can range selection. boolean false
readonly – When true, grid in read only mode. boolean false
resize – When true, columns are resizable. boolean false
row_class – Row class property Define this property in rgRow object and this will be mapped as rgRow class string ‘’
row_definitions – Row properties applied RowDefinition[] []
row_headers – Excel like show rgRow indexe per rgRow RowHeaders | boolean undefined
row_size – Indicates default rgRow size. By default 0, means theme package size will be applied number 0
source – defines main data source. Can be an Object or 2 dimensional array([][]); Keys/indexes referenced from columns Prop DataType[] []
stretch – Defines stretch strategy for columns with @StretchColumn plugin if there are more space on the right last column size would be increased boolean | string true
theme – Theme name “compact” | “darkCompact” | “darkMaterial” | “default” | “material” ‘default’
trimmed_rows – Trimmed rows Functionality which allows to hide rows from main data set { [x: number]: boolean; } {}
use_clipboard – use-clipboard When true enable clipboard. boolean true
Events
- Parameters:
auto_size_column – Autosize config Enable columns autoSize, for more details check @autoSizeColumn plugin By default disabled, hence operation is not resource efficient true to enable with default params (double header separator click for autosize) or provide config boolean | { mode?: ColumnAutoSizeMode; allColumns?: boolean; letterBlockSize?: number; preciseSize?: boolean; } false
can_focus – When true cell focus appear. boolean true
col_size – Indicates default column size. number 100
column_types – Types Every type represent multiple column properties Types will be merged but can be replaced with column properties { [name: string]: ColumnType; } {}
columns – Columns - defines an array of grid columns. Can be column or grouped column. (ColumnRegular | ColumnGrouping)[] []
editors – Custom editors register { [name: string]: EditorCtr; } {}
exporting – Enables export plugin Can be boolean Can be export options boolean false
filter – Enables filter plugin Can be boolean Can be filter collection boolean | { collection?: Record<ColumnProp, FilterCollectionItem>; include?: string[]; customFilters?: Record<string, CustomFilter>; } false
frame_size – Defines how many rows/columns should be rendered outside visible area. number 1
grouping – Group models by provided properties Define properties to be groped by { props?: ColumnProp[]; expandedAll?: boolean; } undefined
pinned_bottom_source – Pinned bottom Source: {[T in ColumnProp]: any} - defines pinned bottom rows data source. DataType[] []
pinned_top_source – Pinned top Source: {[T in ColumnProp]: any} - defines pinned top rows data source. DataType[] []
plugins – Custom grid plugins Has to be predefined during first grid init Every plugin should be inherited from BasePlugin (typeof Plugin)[] undefined
range – When true, user can range selection. boolean false
readonly – When true, grid in read only mode. boolean false
resize – When true, columns are resizable. boolean false
row_class – Row class property Define this property in rgRow object and this will be mapped as rgRow class string ‘’
row_definitions – Row properties applied RowDefinition[] []
row_headers – Excel like show rgRow indexe per rgRow RowHeaders | boolean undefined
row_size – Indicates default rgRow size. By default 0, means theme package size will be applied number 0
source – defines main data source. Can be an Object or 2 dimensional array([][]); Keys/indexes referenced from columns Prop DataType[] []
stretch – Defines stretch strategy for columns with @StretchColumn plugin if there are more space on the right last column size would be increased boolean | string true
theme – Theme name “compact” | “darkCompact” | “darkMaterial” | “default” | “material” ‘default’
trimmed_rows – Trimmed rows Functionality which allows to hide rows from main data set { [x: number]: boolean; } {}
use_clipboard – use-clipboard When true enable clipboard. boolean true
- add_trimmed(*args)
Add trimmed by type (trimmed: Record<number, boolean>, trimmedType?: string, type?: RevoGrid.DimensionRows)
- clear_focus(*args)
Clear current grid focus
- refresh(*args)
Refreshes data viewport. Can be specific part as rgRow or pinned rgRow or ‘all’ by default. refresh(type?: RevoGrid.DimensionRows | ‘all’) => Promise<void>
- scroll_to_column_index(*args)
Scrolls view port to specified column index
- scroll_to_column_prop(*args)
Scrolls view port to specified column prop
- scroll_to_coordinate(*args)
Scrolls view port to coordinate
- scroll_to_row(*args)
Scrolls view port to specified rgRow index
- set_cell_edit(*args)
Bring cell to edit mode (rgRow: number, prop: RevoGrid.ColumnProp, rowSource?: RevoGrid.DimensionRows)
- update_column_sorting(*args)
Update column sorting (column: RevoGrid.ColumnRegular, index: number, order: asc/desc)
- update_columns(*args)
Update columns (cols: RevoGrid.ColumnRegular[])