[GH-ISSUE #358] How to add sub-container with id #162

Open
opened 2026-03-03 16:23:00 +03:00 by kerem · 1 comment
Owner

Originally created by @pavel-blagodov on GitHub (Dec 28, 2023).
Original GitHub issue: https://github.com/mum4k/termdash/issues/358

Hey,

Could you please clarify how to add sub-container with id, so that it can be updated without updating siblings containers. I'm using grid layout

Thank you

Originally created by @pavel-blagodov on GitHub (Dec 28, 2023). Original GitHub issue: https://github.com/mum4k/termdash/issues/358 Hey, Could you please clarify how to add sub-container with id, so that it can be updated without updating siblings containers. I'm using grid layout Thank you
Author
Owner

@mum4k commented on GitHub (Jan 4, 2024):

Thank you for reaching out @pavel-blagodov. To update a sub-container, you would first give that sub-container a known ID using the contained.ID("some_id") option. You can then update any options on that container including sub-splits by calling the container.Update() method as documented in Dynamic Layout and referring back to the same ID.

Please refer to https://github.com/mum4k/termdash/pull/359 which demonstrates this on the termdashdemo. When running the demo, you can press Ctrl-U to update a sub-container (changes widget from green sparkline to a red sparkline). Any other updates are possible as well.

<!-- gh-comment-id:1877221234 --> @mum4k commented on GitHub (Jan 4, 2024): Thank you for reaching out @pavel-blagodov. To update a sub-container, you would first give that sub-container a known ID using the `contained.ID("some_id")` option. You can then update any options on that container including sub-splits by calling the `container.Update()` method as documented in [Dynamic Layout](https://github.com/mum4k/termdash/wiki/Dynamic-layout) and referring back to the same `ID`. Please refer to https://github.com/mum4k/termdash/pull/359 which demonstrates this on the `termdashdemo`. When running the demo, you can press `Ctrl-U` to update a sub-container (changes widget from green sparkline to a red sparkline). Any other updates are possible as well.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#162
No description provided.