ag-Grid: All rows in edit mode when loaded - ag-grid

I have ag-grid which is editable.
I want all rows in edit mode by default when grid is loaded. I know that ag-grid doesn't support this feature. But would like to know that whether there is any way to achieve this ?
I have all type of columns in my grid, text, select, customCellEditor

Related

Set focus on column - Ag Grid React

When we have 200 Columns in an Ag-grid and the user wants to look for a particular column, normally it is done by scrolling and looking for that column but having 200+ columns is going to be annoying.
So we need to develop and search box to search for the column name we scroll and set focus on the given column.
What I have tried
The following code does focus but only on visible columns, if I have to focus on the 100th Column it doesn't work
gridRef.current.api.setFocusedCell(0,gridRef.current.columnApi.columnModel.getAllDisplayedColumns()[10]);
You can use the below method ensureColumnVisibleto make sure the column is visible.
const allColumns = params.columnApi.getAllColumns();
console.log(allColumns);
params.api.ensureColumnVisible(allColumns[allColumns.length - 1].colId); // <- changed here
forked stackblitz

Ag-grid Collapsible Columns in Pivot Mode

In ag-grid I'm trying to use column grouping in pivot mode.
E.g. In the plunker in the below link, a 'sum(Total)' column is displayed after setting gridOptions.pivotColumnGroupTotals = 'before'. Instead of this I would want the 'Gold' column to be displayed by default, and when the column group is expanded 'Silver' and 'Bronze' columns should be displayed along with 'Gold' column.
https://www.ag-grid.com/javascript-grid-pivoting/#pivotColumnGroupTotals
ag-grid has an option to achieve this in non-pivot grids using the column property 'columnGroupShow' as in below link. But not sure how to achieve the same in pivot grids.
https://www.ag-grid.com/javascript-grid-grouping-headers/
Appreciate any help!

Separate row selection from row checkbox selection?

Does ag-grid support separating row selection from checked checkboxes?
My users need to select a row (click on it, or keyboard nav) to see further details about the row. Then they need to check the checkbox (or not) to select the row for later export to Excel.
So for example, they'll click every row to see the further details, but only check some of the checkboxes for later export. Is this supported?
If not, what would be a good approach to implement? Add my own checkboxes to the first column?
You can set suppressRowClickSelection to true when you want checkbox selection, and don't want to also select when the row is clicked. If true, rows won't be selected when clicked.
You can read more about this here - https://www.ag-grid.com/javascript-grid-selection/
You can use ag-Grids selection capabilities for the checkbox selection and then use the onRowClicked prop to do a different select on row click. I'm doing just this (but with onRowDoubleClicked.
You still want to set suppressRowClickSelection to true.

Jface Table row validation

Background:
I have a Jface table on which I have set Editing support with text cell editor for each column. There are around 20 columns.
Problem:
I want to highlight invalid row field text with dark red color and whole row with light red color.
What I tried as of now:
1. I have highlighted invalid field(single cell of row) using label providers getBackgroundColor() and getForgroundColor().
2. I tried CellEditors setValidator() method to add a validator, but I don't want to clear invalid text from a cell, I just want to highlight it.
3. I have one approach to use a flag for each cell to check the validity of that cell if any of the flags is true will highlight all cells of that row(can be achieved using label providers). But, I think this approach will impact performance for my table.
4. I am not sure performance impact of table updatatestrategy of Jface. So I am not using it.
Reason of highlighting the whole row of the table is: Table have 20+ columns and user don't want to scroll the table to find out problem location.
Please suggest if you know any better solutions.
Using label providers to for the colors is the way to do this.
The label provider is only asked for the color when the row is created or refreshed - by calling one of the viewer refresh or update methods, so this should not impact performance.

How to make a specific column be moving in the SWT table in Eclipse RCP?

I have created a SWT table with 23 columns in the Eclipse RCP. The table has only Horizontal Scroll Bar. In runtime, it is obvious that the columns to the left get obstructed when we scroll to Rightward and vice-versa because our view (window) can not display all columns at once. But, I want one of the columns(say col. 2) at Left of the Table to be movable, so that it should be floating at very Left of the table when I scroll the table data Rightward at runtime.
I've tried by setting the col. property movable like :
tblData.getColumn(1).setMoveable(true);
But, it can only make the col.2 be moved (by dragging withing table header). But I wish the column be floating on the table while scrolling (to rightwards/Leftwards) other data in table.
Please, suggest me how to do this.
There is no really cool way of achieving what you want using Table. But there is an official Snippet showing how to emulate something similar here.
If you don't mind using an SWT table implementation which is not natively drawn, apparently NatTable supports "Frozen columns".
Also one of Nebula's custom table implementations might be capable to do what you want. There's Grid and XViewer.