Skip to content
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

Redraw single row #131

Open
kdkavanagh opened this issue Aug 11, 2024 · 1 comment
Open

Redraw single row #131

kdkavanagh opened this issue Aug 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@kdkavanagh
Copy link
Contributor

Is there a way to force the table to re-render a single (specified) row? Usecase is that I'm keeping track of rows that a user "bookmarks", and would like to apply a custom style to those rows. The style is currently applied by overriding get_row_style, which is called after a couple of layers of caching. Is there an easy way to either clear a specific row from those caches, or to force-recompute a single row?

@tconbeer
Copy link
Owner

tconbeer commented Aug 13, 2024

Not today, no. I think if bookmarking is relatively infrequent, I would just blow away the caches entirely.

If you wanted to implement this, you could pull out the logic to compute the row cache key, and then delete that key from the cache:

cache_key = (
row_index,
line_no,
col1,
col2,
base_style,
cursor_location,
hover_location,
selection_anchor_location,
cursor_type,
show_cursor,
self._show_hover_cursor,
self._update_count,
self._pseudo_class_state,
)

The tricky part is that you actually need to delete a whole bunch of records in the row cache, since there may be multiple cache entries with different cursor positions, etc. Hence, I think it's probably better to just delete the cache entirely.

@tconbeer tconbeer added the enhancement New feature or request label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants