When updating a tree that uses footers in React, none of the footer columns are updating once rendered once.
To render the footer once, I can either start the tree expanded, or expand a row to create the footer row. Once rendered, the values never change even when collapsing and re-expanding the row.
I'm not sure why this behavior is different between the grid modes. After many sleepness nights, my current working theory is that the inferred footer row is not being updated or linked to the original row correctly.
There are a couple of discovered workarounds/clues:
1) deltaRowDataMode=false will work as expected. Because we work with react and immutable stores, I believe we still need this mode to be true.
2) Changing the ID field when doing an update also works as expected. To build a full composite key for our table to detect any change, however, would be very complicated as we can have up to 50 columns as a worst case scenario. The key size would also be huge.
//full plnkr example: https://embed.plnkr.co/Ty1AdL2oQzk9MUqnTHQs/
<AgGridReact
columnDefs={this.state.columnDefs}
rowData={this.state.rowData}
treeData={true}
animateRows={true}
groupDefaultExpanded={this.state.groupDefaultExpanded}
getDataPath={this.state.getDataPath}
autoGroupColumnDef={this.state.autoGroupColumnDef}
onGridReady={this.onGridReady}
groupIncludeFooter={true}
groupIncludeTotalFooter={true}
deltaRowDataMode={true}
getRowNodeId={data => data.id}
groupSuppressAutoColumn={true}
/>
I expect the footer values to change when the total row changes, including the name. Using the first workaround (deltaRowDataMode=false) will show the desired behavior.
Any insight into the cause of the re-rendering issue would be appreciated, or a fix to what I may be doing wrong.
As an alternative, groupRowAggNode can be provided that does update as expected. Still unsure why the original problem exists though.
Example:
https://next.plnkr.co/edit/0zTN0RNzapWbtfTW?preview
Related
I have a ui grid that has 20 columns, and I would like to be able to tell what the next column will be as I scroll through the horizontal axis so that I can have some text that will tell the users what the names of all the columns they can't see are.
Anyone know if this is possible? As I watch the the inspector and scroll through the columns, I see html attributes changing.
---UPDATE 1----
This is what is all looks like (where it says "home #" is dynamic and will change to show the next column that is out of site)
Based on the ui-grid configuration that you use to render the grid, you already know the order of the columns. You can use this information together with the visible on each column added by the gird itself.
What you need to do is bind a event handler on scroll to iterate over the columns on each change and check the visibility of them. Then the first one with visible === false is the upcoming.
Here is a working Plunker where is used this flag.
I am working on iOS native app and when trying to read from tableView/tableCells I have a problem getting the updated values. At the first time i enter the page/screen I can see all cells. But , if i create an action that adds another cell to the table view when I try to get the list of cells I see an empty list.
Also, When i change a subelement in that cell I can't see the changed sub element both in inspector and in the code.
I tried switching to a different page and also changing tabs in that page and reread the table/cell and subelements but it didn't help.
I've had this issue before. There is no actual reload elements kind of function that I've seen. However a workaround I've found that works is to simply find an element that exists and it'll reload the elements after it does that.
For example:
yourMethodThatLoadsNewElements();
driver.findElementBy(pathToElementThatExistedBefore);
driver.findElementBy(pathToElementThatWasJustLoaded);
I've got data from 50 states that I'd like to display in the table format (I've also got it mapped) but the table height is so large that you can't scroll down without losing the header row. Since there's 13 columns with yes/no information, once you lose sight of that row it becomes difficult to understand what you're reading.
I would love to be able to freeze the header row so that data below it can scroll (in both x and y axes). I thought about using an image on top of the table but that doesn't work when the table is wider than the body block.
Here's the table.
You'll note I'm having trouble with column width too, as I can't get that last column to stretch out.
Also, my backup plan is to allow users to simply download the table, but I can't figure out how to set the link to download the table.
Thanks in advance for any help!
Embedded tables use the Google Charts table visualization, which supports a fixed header if you set the height. See the configuration options for details.
I have a spreadsheet in which I want to be able to expand the number of columns using a function rather than using auto-fill because the new cells are getting filled with content based on complex formulas and depending on a lot of things.
In one of these cells I want the content to be something like =SUM(A1:A8)
But if I just do cell.setValue("=SUM(A1:A8)") I get "error: Unknown range name A1", unless I afterwards edit the cell content and press enter, without really having changed its content.
Is there any way of fixing this?
I don't want the calculation to be in the expand-columns-function because I do want the cell-calculation to be updated when one of the referenced cells change.
Is there a way of doing it besides having an onEdit-function listening to changes in the referenced cells and updating the calculations?
Thanks
To set a formula on a cell you should use cell.setFormula not setValue.
I'm not sure I understood you "expand" issue completely, but I think an opened range sum function may suit you better than apps-script. e.g.
=SUM(A:A) or =SUM(A2:A)
Is there a way, using Open XML SDK, to set different page size, orientation and margins for the first, even an odd pages. I know how to set different headers and footers for the first, even, and odd pages but I can't figure out how to set different first even and odd page properties (size, margin, orientation) .
Regards.
You can't. Those properties are set at the section level, and sectPr elements are attached to specific paragraphs. They apply to everything in the section (not just odd pages for example).
You can of course set page properties for specific pages, by making a section out of them, but this requires hard coded page breaks / section breaks before and after.