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

Grid & Edit: Form not showing selected grid row after re-creation #2302

Closed
ejstembler opened this issue Sep 17, 2022 · 2 comments
Closed

Grid & Edit: Form not showing selected grid row after re-creation #2302

ejstembler opened this issue Sep 17, 2022 · 2 comments

Comments

@ejstembler
Copy link

ejstembler commented Sep 17, 2022

Short description

I'm implementing the Grid & Edit example. Additionally, I have a date range picker which retrieves data based on the date range, and recreates the grid + form with the data returned for the date range.

This works good the first time it is created. The user clicks a row in the grid and the row data displays correctly in the form.

When the user selects a new date range, and the new grid & form are created, the new data correctly displays in the grid. However, when the user clicks a row, nothing is displayed in the form. I can see the this.get(sel[0]) has the correct data, but it never shows in the form.

I'm wondering if I need to clear something in w2ui if I re-create the grid and form? Or, maybe something is getting disconnected from being re-created?

What is current behavior

Upon re-creation of the grid and edit form, the selected row is not displayed in the form fields.

What is desired behavior

The selected grid row should be displayed in the form fields

Link to jsfidle/codepan with sample code

https://codepen.io/ejstembler/pen/dyevajE

Steps to reproduce or sample

codepen

@vitmalina
Copy link
Owner

You do not need to initialize layout/grid/form each time you update records. Here is the corrected codeped: https://codepen.io/vitmalina/pen/qBYXaMa

@ejstembler
Copy link
Author

Thanks @vitmalina!

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