AG-grid : Changing the font color of parent row when child row cell is edited - ag-grid

I need to change the font-color of the parent row to red when any cell of the child row is edited.
Also the cellStyle for various cells of the child row is displayed in red color when the data is not correct.

I think you can try using redraw API provided by ag grid. Just call the API after the cell value is changed.

Related

Ag Grid pass column width in column definition

I am using Ag Grid with React. I have a page with a dropdown which renders different tables according to the dropdown choice.
Some columns of these tables have content that overflows their width. To deal with this, I have a custom tooltip implemented, which displays the full text content on hover.
The issue is that since I have multiple tables inside a single page, the column widths of my target columns keep changing. I want to pass the column width of the target column as props to cell renderer component in colDef so that I can compare the columnWidth and the text scrollWidth to decide if the text overflows. Let me know any leads for this.

How to clip the cell in a PdfPTable with iText?

I am creating a one column PdfPTable given a Rectangle, at a particilar absolute position. In this table, I need to add a collection of PdfPCells and show as much of the cell content as possible and the cells must be clipped at the table rectangle boundaries. I took care of the width by:
PdfPTable cutTable = new PdfPTable(1);
cutTable.setTotalWidth(200f);
cutTable.setLockedWidth(true);
I have a phrase object in each cell and I add a set of cells to the table. The problem is that the cells overflows the table height boundary and it is not clipped. I tried keeping track of the total cells' height after adding each cell, but the problem is that since I ask the table for the row height, a cell must be inserted before and my calculation is off as the last cell overflows.
How do I get the table to clip the cell contents at its boundaries? If I can't do this, how do I determine the height of the cell(the phrase uses Arial 8 font) with the default text wrapping, before it is added to the table?
Thanks in advance for your help.
Take a look at the CellHeights example from my book "iText in Action." It uses the different options to set the height of a cell. I think you need the setFixedHeight() method. When using this method, all content added to the cell that doesn't fit the height will be dropped.

SWT List cell renderer

How to set a cell renderer for SWT list? I want to have a list with text, and every line must have a different foreground.
Sorry, but that cannot be done for list, only for a Table. See Table example snippet: draw different foreground colors for text in a TableItem.

Cell Separator Style

How can we set Separator style at cell level. i.e. each cell will be having different separator style?
I don't think you can set the cell separator style per cell. You might try setting the table view separator to UITableViewCellSeparatorStyleNone and then draw a custom "separator" yourself when you render out each cell.
Edit: How to do it depends a lot on your current code, what type of table, whether you are using a custom table cell, what exactly you mean by "different separator style", etc.
I have not tried this, but one option I can think of off the top of my head would be to use the UITableViewCell.backgroundView property. You could add a subview with a different color that is only a few pixels high along the bottom or you could create a UIImageView that fills the backgroundView and set the image to achieve the "different" separator.

How to change the background color of a table view cell after it was moved?

I have a table view with 9 rows at minimum. The background colors of the cells will depend of the cell position. If it is bellow to 3 or below to 6 or below to 9, the background color changes (see the next image).
The problem is that this table view can be reordered and I have to maintain the same color pattern. Example: if i change the 4th row to the 3th position, its background color must change from yellow to red.
To get the different colors, I used the method - (void)tableView:(UITableView*)tableView willDisplayCell:(UITableViewCell*)cell forRowAtIndexPath:(NSIndexPath*)indexPath, but this method is called only when the cell will be displayed and isn't good for reordering issues (the cell is already displayed and the color don't change).
I already tried to create a method to change the background color that is called just after the row was moved, but the color didn't changed (it seems that changing the background color with cell.backgroundColor property just works in - (void)tableView:(UITableView*)tableView willDisplayCell:(UITableViewCell*)cell forRowAtIndexPath:(NSIndexPath*)indexPath). :(
Any ideas how I can do that?
Thanks in advance.
Adjust the position in your data source however you are doing, then tell your data source to recalculate the colours for each item based on their current position. Then reload your table view. It should "just work".