| setRowData(rows) |
Set new rows into the grid. |
| updateRowData(transaction) |
Update row data into the grid. Pass a transaction object with lists for add, remove and update. |
| setDatasource(datasource) |
Set new datasource into the grid. The grid will reset all paging
and load the first page. If you want to reset the paging but keep the
datasource, call this method with the same datasource. |
setPinnedTopRowData(rowData)
setPinnedBottomRowData()
getPinnedTopRowCount()
getPinnedBottomRowCount()
getPinnedTopRow(index)
getPinnedBottomRow(index)
|
Methods for getting and setting the data and getting the Row Nodes of the pinned rows.
|
| getModel() |
Returns the row model inside the table. From here you can see the original rows, rows after filter has
been applied, rows after aggregation has been applied, and the final set of 'to be displayed' rows.
|
| refreshClientSideRowModel(params) |
Gets the Client-side Row Model to refresh, executing the grouping, filtering and sorting again.
|
| getRowNode(id) |
Returns the row node with the given ID. The row node id is the one you provide with the callback getRowNodeId(data), otherwise the id is a number auto generated by the grid when the row data is set.
|
| forEachNode((node, index)) |
Iterates through each node (row) in the grid and calls the callback for each node. This works similar to the 'forEach' method on a Javascript array. This is called for every node, ignoring any filtering or sorting applied within the grid. If using infinite row model, then gets called for each page loaded in the page cache.
|
| forEachNodeAfterFilter((node, index)) |
Similar to forEachNode, except skips any filtered out data.
|
| forEachNodeAfterFilterAndSort((node, index)) |
Similar to forEachNode, except skips any filtered out data and each the callback is called in the order the rows are displayed in the grid.
|
| forEachLeafNode((node, index)) |
Similar to forEachNode, except lists all the leaf nodes. This effectively goes through all the data that you provided the grid before the grid did any grouping. If doing tree data, then goes through all the nodes for data you provided, including nodes that have children, but excluding groups the grid created where gaps were missing in the hierarchy.
|
| getDisplayedRowAtIndex(index) |
Returns the displayed rowNode at the given index.
|
| getDisplayedRowCount() |
Returns the total number of displayed rows.
|
| getFirstDisplayedRow() |
Get the index of the first displayed row due to scrolling (includes not visible rendered rows in the buffer)
|
| getLastDisplayedRow() |
Get the index of the last displayed row due to scrolling (includes not visible rendered rows in the buffer)
|
| selectAll() |
Select all rows (even rows that are not visible due to grouping being enabled and their groups not expanded). |
| deselectAll() |
Clear all row selections. |
| selectAllFiltered() |
Select all filtered rows. |
| deselectAllFiltered() |
Clear all filtered selections. |
| getSelectedNodes() |
Returns a list of selected nodes. Getting the underlying node (rather than the data) is useful when working
with tree / aggregated data, as the node can be traversed. |
| getSelectedRows() |
Returns a list of selected rows (ie row data that you provided). |
| getBestCostNodeSelection() |
Returns a list of all selected nodes at 'best cost' - a feature to be used
with groups / trees. If a group has all its children selected,
then the group appears in the result, but not the children.
Designed for use with 'children' as the group selection type,
where groups don't actually appear in the selection normally. |
| getRangeSelections() |
Returns the list of selected ranges. |
| addRangeSelection(rangeSelection) |
Adds to the selected range. |
| clearRangeSelection() |
Clears the selected range. |
| setQuickFilter(quickFilter) |
Pass a quick filter text into ag-Grid for filtering. If using Angular, the grid watched the 'quickFilterText'
attribute of the gridOptions. If you won't want to use quickFilterText (ie if not using AngularJS) then you can
call this method instead to apply a quick filter.
|
| isQuickFilterPresent() |
Returns true if the quick filter is set, otherwise false.
|
| isColumnFilterPresent() |
Returns true if any column filter is set, otherwise false.
|
| isAnyFilterPresent() |
Returns true if any filter is set. This includes quick filter, advanced filter or external filter.
|
| getFilterInstance(col) |
Returns the filter component instance for the column. Either provide the colDef (matches on object
reference) or the column field attribute (matches on string comparison). Matching by field
is normal. Matching by colDef is useful when field is missing or not unique.
|
| getFilterModel() |
Gets the current state of all the advanced filters. Used for saving filter state.
|
| setFilterModel(model) |
Sets the state of all the advanced filters. Provide it with what you get from getFilterModel()
to restore filter state.
|
| onFilterChanged() |
Informs the grid that a filter has changed. This is typically called after a filter
change through one of the filter APIs.
|
| destroyFilter() |
Destroys a filter, useful to create get a particular filter created from scratch again. |
| onSortChanged() |
Gets the grid to act as if the sort was changed. Useful if you update some values in the grid and
want to get the grid to reorder them according to the new values. |
| setSortModel(model) |
Sets the sort state of the grid.
|
| getSortModel() |
Returns the sort state of the grid.
|
| setAlwaysShowVerticalScroll(show) |
If true, the vertical scrollbar will always be present even if not required, otherwise, it will only be
displayed when necessary.
|
| ensureIndexVisible(index, position) |
Ensures the row index is visible by vertically scrolling the grid. The valid values for positions are
{'top', 'middle', 'bottom', undefined/null}. If top, middle
or bottom, the grid will scroll the row to place the row at top, middle or bottom.
If undefined or null then grid will do the minimum scrolling to show
the row, ie if grid needs to scroll up then it will scroll so that the row is at the top, if the grid
needs to scroll down then it will scroll so that the row is at the bottom, if the row is already in view
then the grid will do nothing.
|
| ensureNodeVisible(comparator, position) |
Ensures a node is visible, scrolling the table if needed. Provide one of a) the node
b) the data object c) a comparator function (that takes the node as a parameter, and returns
true for match, false for no match). The valid values for positions are same as for
api.ensureIndexVisible().
|
| ensureColumnVisible(colId) |
Ensures the column is visible, scrolling the table if needed. |
| getHorizontalPixelRange() |
Returns a JSON object with two properties:
-
left: The left pixel position of the current scroll in the grid
-
right: The right pixel position of the current scroll in the grid
|
| getVerticalPixelRange() |
Returns a JSON object with two properties:
-
top: The top pixel position of the current scroll in the grid
-
bottom: The bottom pixel position of the current scroll in the grid
|
| paginationIsLastPageFound() |
Returns true when last page known. This will always be true if you are using the Client-side Row Model
for pagination.
Returns false when last page now known. This only happens when using Infinite Scrolling Row Model.
|
| paginationGetPageSize() |
How many rows ag-Grid is showing per page.
|
| paginationSetPageSize(newPageSize) |
Sets the paginationPageSize to newPageSize Then it repaginates the grid so the changes
are applied immediately on the screen.
|
| paginationGetCurrentPage() |
Returns the 0 index based page which ag-Grid is showing right now.
|
| paginationGetTotalPages() |
Returns the total number of pages. If paginationIsLastPageFound() == false returns null.
|
| paginationGetRowCount() |
The total number of rows. If paginationIsLastPageFound() == false returns null.
|
| paginationGoToPage(pageNumber) |
Goes to the specified page. If the page requested doesn't exist, it will go to the last
page.
|
paginationGoToNextPage() paginationGoToPreviousPage() paginationGoToFirstPage() paginationGoToLastPage() |
Shorthands for goToPage(relevantPageNumber).
|
| setPopupParent(element) |
DOM element to use as popup parent for grid popups (context menu, column menu etc). |
| addRenderedRowListener(event, rowIndex, callback) |
Registers a callback to a virtual row. A virtual row is a row that
is visually rendered on the screen (rows that are not visible because
of the scroll position are not rendered).
Unlike normal events, you do not need to unregister rendered row listeners.
When the rendered row is removed from the grid, all associated rendered row listeners will
also be removed. Currently only one event: 'virtualRowRemoved' - listen
for this event if your cellRenderer needs to do clean down after the
row no longer exists.
|
| showToolPanel(show) |
Shows (or hides) the tool panel. |
| isToolPanelShowing() |
Returns true if the tool panel is showing, otherwise false. |
| doLayout() |
Force the grid to lay out its components. The grid, by default, resizes to fit
the div the grid lives in. This is done a) on initialisation b) window resize
and c) every 500ms. You should call this if something happens in your application
where the grid size has changed and you want to lay the grid out without waiting
for the next 500ms refresh. |
| getValue(colKey, node) |
Gets the value for a column for a particular rowNode (row).
This is useful if you want the raw value of a cell eg implementing your own csv export.
|
| destroy() |
Gets the grid to destroy and release resources. If you are using Angular (version 1 or 2)
you do not need to call this, as the grid links in with the AngularJS 1.x lifecycle. However if you
are using Web Components or native Javascript, you do need to call this, to avoid a memory
leak in your application.
|
| showColumnMenuAfterButtonClick(colKey, buttonElement), showColumnMenuAfterMouseClick(colKey, mouseEvent) |
Shows the column menu after and positions it relative to the provided element (button click) or mouse
event. Use in conjunction with your own header template. |
| checkGridSize() |
Gets the grid to check its size again. This is useful if you do not have the grid in the DOM
when you create it, call this method after the grid is in the dom to get it to check its width
and height again (which decides what columns and rows to render). |
| resetRowHeights() |
Gets the grid to recalculated the row heights. |
| onRowHeightChanged() |
Tells the grid a row height has changed. To be used after calling rowNode.setRowHeight(newHeight). |
| copySelectedRowsToClipboard(includeHeaders, columnKeys) |
Copies the selected rows to the clipboard. Set includeHeaders = true to include the headers (default is false)
set columnKeys to the list of columns if you don't want just specific columns. |
| addAggFunc(key, aggFunc), addAggFuncs(aggFuncs), clearAggFuncs() |
Adding and clearing of aggregation functions. |
| hidePopupMenu() |
Hides any showing context menu
or column menu.
|
| setSuppressRowDrag(value) |
Sets the suppressRowDrag property.
|
| setGridAutoHeight(value) |
Sets the gridAutoHeight property.
|
| isAnimationFrameQueueEmpty() |
Returns true if the grid has animation frames to execute.
|