Hello,
I need a grid with at calculated hight. For this, I have a div around the grid with a calc expression for the height and the grid height set to 100%.
The issue is that the e-gridcontent is larger than the grid should be and the reason is that the height on the e-gridcontent is set to "calc(100% - 44px);". This means that only the column-header (e-gridheader) is substracted and the height of my custom toolbar (via template) is getting ignored.
I tried setting the height on the toolbar directly but that did not do anything.
Can you please assist?
Best regards,
Marco
Hi Marco,
Greetings from Syncfusion support.
Thank you for reaching out to us with your inquiry. We understand that you need assistance in resolving an issue you are facing with our grid. In order to provide an accurate and effective solution, we kindly ask that you provide us with the following information:
This will enable us to fully understand the problem and provide you with the best possible solution. We apologize for any inconvenience this may cause and we are here to assist you every step of the way. Please let us know if there is anything else we can do to help.
Regards,
Joseph I.
Hi Joseph,
I'm using @syncfusion/ej2-angular-grids@20.4.44 and my requirement is very simple: I need the grid to scale with the size of the browser vh with exact measurements, not with percent values. An example would be: calc(100vh-256px)
That is all.
Currently I have a div around the grid that has my height setting and a grid with the height set to 100%. Like this:
<div style="height: calc(100vh - 256px)">
<ejs-grid height="100%">
[...]
</ejs-grid>
</div>
This generally works with scaling the grid but my issue with this is, that when scrolling down the grid, it will cut off part of the last item. From what I can see when looking at the generated html code is that the generated e-gridcontent, that contains the grid rows, is extending over the actual grid height and therefore not fully visible. I suspect the issue is that I use a toolbar template like this:
<div style="height: calc(100vh - 256px)">
<ejs-grid height="100%">
<ng-template #toolbarTemplate let-data>
[...]
</ng-template>
[...]
</ejs-grid>
</div>
Hello,
do you have any update for me here?
Best regards,
Marco
Hi Marco,
Our team is working on the reported issue. We apologize as it is taking little more time than usual. Team will update the details by today.
Regards,
Suganya Gopinath.
Marco,
We have validated your query, by preparing a sample from our side, but we were not able reproduce the issue from our side. Please refer the below sample and screenshot for your reference.
Sample: https://stackblitz.com/edit/angular-bdg2wa?file=src%2Fapp.component.html,src%2Fapp.component.ts
Screenshot:
Here in this sample, the height of the toolbar is 42px and the header row is 44px, as you can see the content id `100%-86px`. If you still face the issue, kindly share the below details.
Hi Joseph,
I modified your example to match my implementation and I was able to reproduce the issue:
https://stackblitz.com/edit/angular-bdg2wa-jltmke?file=src/app.component.html
When you scroll down in the example, you will see that the last row is not completly visible as the gridcontent is too large.
Best regards,
Marco
Marco,
On inspecting the sample provided, we could see that you are rendering the grid inside a card component, when you render the grid in other components like card, dialog or tab, the grid contents height will ignore the height of the toolbar and pager in the grid. This is the reason for the reported behavior, we suggest you to add the toolbar height to the grids content element in the dataBound event of the EJ2 Grid.
[app.component.css] .add-height { height: calc(100% - 84px) !important; }
[app.component.ts]
dataBound() { (this.grid.element.querySelector('.e-gridcontent') as any).classList.add( 'add-height' ); }
|
Hi Joseph,
thank you for the response. I've implemented this though I feel this is more of a workaround than a solution.
Do you consider this behavior to be a bug that will be fixed in a future version? From my point of view it should be because why should it not consider the toolbar hight in specific containers?
Best regards,
Marco
Marco,
We have confirmed the reported scenario as a usability improvement from our side and logged as “Grid's Content cropped when rendering with toolbar template inside a card component”. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and will include the defect fix in our patch release scheduled to be rolled out on 15th March, 2023. We appreciate your patience until then.
You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link.
Regards,
Joseph I.
Marco,
We are glad to announce that our Essential Javascript2 patch release (v20.4.54) has been rolled out successfully and in that release, we have added the fix for the issue - “Grid's Content cropped when rendering with toolbar template inside a card component”. So please update your packages to this version to include this fix.
Release Notes: https://ej2.syncfusion.com/angular/documentation/release-notes/20.4.53/?type=all#grid
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.