If using the new style context, re-declare this in your class to be the
React.ContextType
of your static contextType
.
Should be used with type annotation or static contextType.
static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
Readonly
propsStatic
Optional
contextIf set, this.context
will be set at runtime to the current value of the given Context.
Usage:
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
Gets/Sets the advanced filtering state.
let advancedFilteringExpressionsTree = this.grid.advancedFilteringExpressionsTree;
this.grid.advancedFilteringExpressionsTree = logic;
Gets/Sets cell selection mode.
By default the cell selection mode is multiple selectionMode: GridSelectionMode
Sets the key of the row island by which child data would be taken from the row data if such is provided.
Controls the copy behavior of the grid.
Emitted before IgxColumnComponent
is pinned.
The index at which to insert the column may be changed through the insertAtIndex
property.
public columnPinning(event) {
if (event.column.field === "Name") {
event.insertAtIndex = 0;
}
}
Emitted before IgxColumnComponent
is pinned.
The index at which to insert the column may be changed through the insertAtIndex
property.
public columnPinning(event) {
if (event.column.field === "Name") {
event.insertAtIndex = 0;
}
}
Emitted after IgxColumnComponent
is pinned.
The index that the column is inserted at may be changed through the insertAtIndex
property.
public columnPinning(event) {
if (event.column.field === "Name") {
event.insertAtIndex = 0;
}
}
Emitted after IgxColumnComponent
is pinned.
The index that the column is inserted at may be changed through the insertAtIndex
property.
public columnPinning(event) {
if (event.column.field === "Name") {
event.insertAtIndex = 0;
}
}
Gets/Sets column selection mode
By default the row selection mode is none selectionMode: GridSelectionMode
Gets an array of IgxColumnComponent
s.
const colums = this.grid.columns.
Returns the IgxGridHeaderGroupComponent
's minimum allowed width.
Used internally for restricting header group component width. The values below depend on the header cell default right/left padding values.
Gets the default row height.
const rowHeigh = this.grid.defaultRowHeight;
Gets the custom template, if any, used for row drag ghost.
The custom template, if any, that should be used when rendering the row drag indicator icon
Gets the excel style header icon.
Emitted when a copy operation is executed.
Fired only if copy behavior is enabled through the [clipboardOptions
]IgxGridBaseDirective#clipboardOptions.
Emitted when a copy operation is executed.
Fired only if copy behavior is enabled through the [clipboardOptions
]IgxGridBaseDirective#clipboardOptions.
Gets the header row selector template.
Gets the row collapse indicator template.
Gets the header expand indicator template.
Gets/Sets if the row selectors are hidden.
By default row selectors are shown
Gets/Sets the locale.
If not set, returns browser's language.
Controls whether columns moving is enabled in the grid.
Emitted when making a range selection.
Range selection can be made either through drag selection or through keyboard selection.
Emitted when making a range selection.
Range selection can be made either through drag selection or through keyboard selection.
Emitted after the ngAfterViewInit hook. At this point the grid exists in the DOM
Emitted after the ngAfterViewInit hook. At this point the grid exists in the DOM
Gets/Sets the resource strings.
By default it uses EN resources.
Gets the row add text template.
Gets the row collapse indicator template.
Emitted when dropping a row.
Return the dropped row.
Emitted when dropping a row.
Return the dropped row.
Emitted when start dragging a row.
Return the dragged row.
Emitted when start dragging a row.
Return the dragged row.
Gets the row edit actions template.
Gets the row edit text template.
Gets the row expand indicator template.
Gets/Sets row selection mode
By default the row selection mode is 'none' Note that in IgxGrid and IgxHierarchicalGrid 'multipleCascade' behaves like 'multiple'
Gets the row selector template.
Gets/Sets whether clicking over a row should select/deselect it
By default it is set to true enabled: boolean
Gets/Sets whether the columns should be auto-generated once again after the initialization of the grid
This will allow to bind the grid to remote data and having auto-generated columns at the same time. Note that after generating the columns, this property would be disabled to avoid re-creating columns each time a new data is assigned.
this.grid.shouldGenerate = true;
Gets/Sets the display time for the row adding snackbar notification.
By default it is 6000ms.
The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in asc order.
The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in desc order.
Gets custom template, if any, that should be used when rendering a header sorting indicator when columns are not sorted.
Get/Set IgxSummaryRow height
Emitted when an export process is initiated by the user.
toolbarExporting(event: IGridToolbarExportEventArgs){
const toolbarExporting = event;
}
Emitted when an export process is initiated by the user.
toolbarExporting(event: IGridToolbarExportEventArgs){
const toolbarExporting = event;
}
Returns the total number of records.
Only functions when paging is enabled.
const totalRecords = this.grid.totalRecords;
Gets/Sets the width of the grid.
let gridWidth = this.grid.width;
Optional
UNSAFE_Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
16.3, use componentDidMount or the constructor instead
Optional
UNSAFE_Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
16.3, use static getDerivedStateFromProps instead
Optional
UNSAFE_Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
16.3, use getSnapshotBeforeUpdate instead
Collapses the row by its id.
ID is either the primaryKey value or the data record instance.
this.grid.collapseRow(rowID);
rowID The row id - primaryKey value or the data record instance.
Optional
componentOptional
componentCalled immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Optional
componentCalled immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
16.3, use componentDidMount or the constructor instead; will stop working in React 17
Optional
componentCalled when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
16.3, use static getDerivedStateFromProps instead; will stop working in React 17
Optional
componentOptional
componentCalled immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
Removes the IgxGridRowComponent
and the corresponding data record by primary key.
Requires that the primaryKey
property is set.
The method accept rowSelector as a parameter, which is the rowID.
this.grid1.deleteRow(0);
rowSelector
Deselects all rows
By default if filtering is in place, selectAllRows() and deselectAllRows() select/deselect all filtered rows. If you set the parameter onlyFilterData to false that will deselect all rows in the grid exept deleted rows.
this.grid.deselectAllRows();
onlyFilterData
Expands the row by its id.
ID is either the primaryKey value or the data record instance.
this.grid.expandRow(rowID);
rowID The row id - primaryKey value or the data record instance.
Returns the IgxColumnComponent
by field name.
const myCol = this.grid1.getColumnByName("ID");
name
Gets the width
to be set on IgxGridHeaderGroupComponent
.
Gets calculated width of the pinned area.
const pinnedWidth = this.grid.getPinnedWidth();
takeHidden If we should take into account the hidden columns in the pinned area.
Get the currently selected ranges in the grid.
Optional
getRuns before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Triggers change detection for the IgxGridComponent
.
Calling markForCheck also triggers the grid pipes explicitly, resulting in all updates being processed.
May degrade performance if used when not needed, or if misused:
// DON'Ts:
// don't call markForCheck from inside a loop
// don't call markForCheck when a primitive has changed
grid.data.forEach(rec => {
rec = newValue;
grid.markForCheck();
});
// DOs
// call markForCheck after updating a nested property
grid.data.forEach(rec => {
rec.nestedProp1.nestedProp2 = newValue;
});
grid.markForCheck();
grid.markForCheck();
Opens the advanced filtering dialog.
Selects all rows
By default if filtering is in place, selectAllRows() and deselectAllRows() select/deselect all filtered rows. If you set the parameter onlyFilterData to false that will select all rows in the grid exept deleted rows.
this.grid.selectAllRows();
this.grid.selectAllRows(false);
onlyFilterData
Get current selected columns.
Returns an array with selected columns
const selectedColumns = this.grid.selectedColumns();
Toggles the row by its id.
ID is either the primaryKey value or the data record instance.
this.grid.toggleRow(rowID);
rowID The row id - primaryKey value or the data record instance.
Static
_create
Row island
Igx Module
IgxHierarchicalGridModule
Igx Parent
IgxHierarchicalGridComponent, IgxRowIslandComponent