Ag-grid valueGetter does not fire when "Column" is out of view or hidden - calculated-columns

Use: We use ag-grid like we would use excel on our client software. In it we have some custom calculations that I run with the valueGetter function. Our grid has over 50 ColumnDefs. This means that some of the columns are not in view until you scroll right or left respectively. All my functions work and I have no calculation issues.
Issue: When I edit a Value I have some columns that now need to fire the valueGetter. For the columns that are currently in view they fire and run the calcs without issues, however there are some columns that are out of view and some columns are hidden. On these specifically the grid will not run the value getter until it is in view or the hidden flag on the column has been set to false.
The main reason for this being an issue is that because the grid is so wide I have to hide and show certain columns as a "view Groups". I need to know if there is a gridOptions setting or grid Directive that I am missing? Or is there another solution where I can have the calculations for the entire runs when I edit a field.
ag-grid version 23.0.2
angular version 8

Not sure if you are using Adaptable with your AG Grid implementation but if you are then this might help:
We had this issue a while back and we solved it by moving the custom calculations out of AG Grid and into Adaptable's Calculated Columns which will evaluate whenever any relevant cell in the row updates.

Related

Disable sorting on one or more grid columns in Kendo UI for Angular

I'm playing around a bit with Kendo UI for Angular and can't seem to find an easy way to disable sorting on specific columns of a grid.
There's an allowUnsort in sort-settings.d.ts, but I'm uncertain on how to use this (and this appears to relate to removing sorting afterwards, not from the start).
Or perhaps I'm simply using the grid wrong, that's also possible..
My situation is as follows:
I'm trying to use a grid to display some rows, and depending on the type of data, it should render a different icon in the first column. Also, I'm not using a 'real' header in that column, but replaced it with a button to create a new row.
To get my button in the header, I use a <template kendoGridHeaderTemplate ...>...</template>. This always seems to add a link around the header cell if sortable is enabled, which is what I'm trying to avoid (in some cases).
Is there a way around this?
Setting [sortable]="true" for the Grid component will enable sorting globally. Then you can fine-tune which column has sorting by disabling it per column, i.e [sortable]="false"
Here is a quick example:
http://plnkr.co/edit/hLbzC5jKJwVdMtRmh0cH?p=preview

Kendo UI For Angular2 - Grid Row Select

I have a working <kendo-grid> component with 10 visible rows over a data set of 34 rows (approx 4 pages). Sorting and selecting is working as expected.
<kendo-grid [data]="gridView"
[pageSize]="pageSize"
[skip]="skip"
[pageable]="true"
[height]="300"
(pageChange)="pageChange($event)"
[sortable]="{ mode: 'single' }"
[sort]="sort"
[selectable]="true"
(sortChange)="sortChange($event)"
(selectionChange)="selectionChange($event)">
Say I select second row. Then I sort the table and the selection stays on row two but of course it's highlighting a different record. It's always selecting the second row on the grid, which of course, it's what I want.
How do I clear the selected row in my (sortChange) event so at least the user isn't presented with a different selection that they one they already chose. I am open to some kind of data binding attribute for selected row that I could set to null or some property on gridView or even poking around inside #ViewChild .
Any help would be appreciated.
Normal Sort
Ascending Sort
Descending Sort
I had a similar question here: Select grid row item from code
Basically, you also need to select the grid row item from code without user interaction and this is currently not supported in the current beta build of the Kendo UI Angular2 controls.
In my application, I resort to triggering a click event on the row I want to select. :/
I do this in a case where I have 'up' and 'down' buttons to rearrange the grid and want to maintain my selection when I switch items.
var grid = document.getElementById('myGrid');
var rows = grid.getElementsByTagName('tr');
rows[idx].click(); // add one to the desired row index to skip the header row
Here's a (sloppy, minimal) Plunkr of this scenario: http://plnkr.co/edit/09dlqdl0Xchoy0e5zKRq

Add/Remove gridlines in cells containing data in the cells

I am creating a work planner using Excel. The user selects a specific name from a drop down menu and it displays the projects. I want a table/gridline to be displayed. I would like it to add a gridline which automatically shows/hides when a name is selected but the height should be dependent on the rows of data. So if there are a 5 projects the table should be 5 columns long.
I have implemented a formula using Conditional Formatting (=NOT(ISBLANK(D6))), but the table still shows if I select the default option which shows no names.
Bit tricky without knowing what's in D6! - but presume it's your dropdown... in which case don't you want this an absolute reference $D$6?
One other thing to try is having multiple rules, so setup conditional formatting so that ISBLANK(D6) then no borders (make sure it's the first rule and to tick 'stop if true' to stop it running through to your NOT(ISBLANK) rule)

SSRS won't expand the row height when exported to Excel

I have a report I am doing with SSRS 2008 with some rows that have multiple elements inside them. On the preview the row automatically expands to support the extra elements but however when I export the report to Excel it appears only as a single row with just the one element displayed, although all the elements are there when I double click the row or manually expand it.
I've checked everything...Can grow is set to true and the properties on the text box allows it's height to increase however it seems to ignore these.
Here it is in the preview
http://tinypic.com/r/b4wbdg/8
In Excel
http://tinypic.com/r/r084g3/8
Sorry about the links to the pictures and not in this question
Both CanGrow and CanShrink properties should be set to false. There is nothing like CanGrow and CanShrink in Excel. By setting them to false it will display the height as it is. Otherwise it will set the height to a default value.
This worked for me. Check this Row height not preserved when exporting to Excel thread for more suggestions.
Came across this (again) recently and thought I'd share my take...
Whether Excel correctly renders the height has to do with merged columns. Take note of your column alignments throughout all objects on the page. Any objects not tied to the data table itself (or embedded inside the data table) must be aligned with the columns of the table in question, at least for the cells that need to wrap text. If there is any overlap causing the table columns to be split and the cells of wrapped text to be re-merged, Excel will not recognize the row height by either setting the CanGrow to True or snapping the row to fit within Excel.
In the original post, the user mentioned rows with multiple elements inside of them. It is possible that those elements caused the column to split for the surrounding subtotals or adjacent groups with wrapped text.
Setting the CanGrow to False will simply prevent any automatic sizing of the row height by default for both the web view and Excel export, so I don't know if that's the ideal solution to this problem.
Both CanGrow and CanShrink properties should be set to false
This must be done for all cells in the row of the Tablix!!
Otherwise the data is not properly exported.
reduce the widths of the rows and it fixed my problem
I remove the header of the report, and all works perfectly.
I have other reports and I see now that if I remove the textboxes that are included on the sheet when exporting to excel, then the row heights in excel are sized properly.
I know this is an old question but I've been struggling with it. My issue was that I had a second field in a column where I inserted a placeholder underneath the field in the column. When exporting to Excel I wanted it to be tall enough that the second field would show underneath the main field in the column.
To get it to work for me, I inserted a blank column next to it and made it just wide enough for a single character. Then I click and hit enter several times to force it to be multiple lines. When I export, I have a blank column but otherwise it worked for me.

Specifying which column a button will be placed in

I am using TableLayout, and when I am placing a button, I want to specify which column the button should be placed in. For example, column 4. The dirty way to go around this is to place 3 empty views before I place the button.
But, is there a better way? I was told to use android:layout_column="4" in the code, but it made the application crash.
The solution that I found is by using the view its basically an empty view that just takes up space in the view its placed in. Alternatively a can be used, will be able to do what I wanted to do before BUT unfortunately the columns and rows aren't distributed evenly or automatically which is a drawback.

Resources