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

Checkboxes resetting on page change #178

Closed
timbze opened this issue Jun 23, 2020 · 1 comment
Closed

Checkboxes resetting on page change #178

timbze opened this issue Jun 23, 2020 · 1 comment

Comments

@timbze
Copy link
Contributor

timbze commented Jun 23, 2020

In docs here it is mentioned that Blazor pages using checkboxes may require to use the ShouldRender method to suppress UI refreshing.

I'm trying to figure out in the code how I can avoid this, but can not figure out why CheckboxComponent keeps reloading on every `StateHasChanged()'. Is there a way to avoid this or why is this issue there? With this work-around it becomes almost impossible to do anything else on the page while still keeping the checkbox states.

@gustavnavar
Copy link
Owner

It's not mandatory to use the ShouldRender method on a Blazor page contaning a grid with checboxes.

If the page is rendered for whatever reason, all CheckboxComponents will be reloaded. In older versions checked rows were managed by rowid and a page rerender forced to reinitialize checkboxes's information. But in version 1.6.9 they are managed by row keys and a page rerender will not reinitialize checkboxes's information.

So you can avoid using the ShouldRender method now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants