Hi Team,
I created a small sample project where I try to display vertical rows on a small screen. The current CSS file weighs 1.5MB and I would like to have css as small as possible. What should I add to the project to achieve it? How to switch programmatically from horizontal to vertical rows?
Hi Roman Sznajder,
Greetings from Syncfusion support!
To reduce the CSS file size in your Syncfusion Angular Grid project and enable vertical row rendering for small screens, please consider the following approaches:
Use Theme Studio to Generate Custom Minified CSS:
Referencing Only Dependent Styles (Individual CSS Files):
Instead of importing the entire Syncfusion theme CSS, you can import only the styles required for the components you're using. This helps reduce bundle size and improve performance, especially when you're using a few components like Grid, DropDownList, etc.
https://ej2.syncfusion.com/angular/documentation/grid/getting-started#adding-css-reference
Note : The Syncfusion Grid has internal dependencies on other components like Buttons, Popups, Navigations, Inputs, etc. So it's important to include only the required ones based on your usage (e.g., if you use filtering , include DropDowns ).
For more information please visit documentation Link :
Query : Switching from Horizontal to Vertical Rows
To programmatically switch between horizontal and vertical row layouts for small screens, you can use the rowRenderingMode property of the Grid and set its value to "Horizontal"
Code Example :
|
We already have documentation available on this topic. Please refer to the links below for more information
Sample Link : https://stackblitz.com/edit/angular-3mec7fqq?file=src%2Fapp.component.ts
Documentation Link : https://ej2.syncfusion.com/angular/documentation/grid/adaptive#vertical-row-rendering
Feel free to get back to us if you need any further assistance.
Regards,
Sivaranjani R
Hi Sivaranjani,
In my sample project I exactly did what you mentioned in your response. I added these styles:
e-bigger styles, which are essential for adaptive layout functionality. This is the intended behavior of the Lite theme.