-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get variable height on multiple GSTCs depending on filled rows #352
Comments
Maybe this will help - it will change the height automatically based on the currently expanded rows. function watchRowsAndChangeHeight(gstc) {
const state = gstc.state;
gstc.component.vidoInstance.onDestroy(
state.subscribe('$data.list.rowsWithParentsExpanded', (rowsWithParentsExpanded) => {
const rowsData = gstc.api.getRowsData();
let height = 0;
for (const rowId of rowsWithParentsExpanded) {
height += rowsData[rowId].actualHeight;
}
state.update('config.innerHeight', height + state.get('config.scroll.horizontal.width'));
})
);
}
// pseudo code
function mountGSTC() {
gstc = GSTC({
element,
state,
});
watchRowsAndChangeHeight(gstc);
} auto-height.mp4 |
PS Your code will not work properly because you are writing successive instances to the same variable |
Thank you, I just corrected the same variable problem. Interestingly, it still worked somehow. This does not quite solve my problem. Is there an option to check whether the gstcResult object's displayed rows are empty or not? For example it has 3 rows but only row 1 and 2 have items inside of them - can I check that row 3 is empty? Thank you for your time! |
Your question and description of the problem goes here
Is there a way to adapt the total height of the calendar depending on the rows used?
Currently I am using 4 gstcs below each other. Some have 3 rows, others only have 2 rows. Some have multiple entries in a single row, some only have a single entry per row. Depending on the amount of rows and overlapping items per row, each of those gstcs needs to have a different height. If I am adding a new entry to a specific gstc, its height needs to increase.
How am I able to automatically adapt the height of each gstc and not set a fixed height in a wrapper?
Code
Second question is if I am using the correct way to display all calendars in Angular.
Thank you very much in advance.
The text was updated successfully, but these errors were encountered: