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

support for dynamically added elements #47

Open
staabm opened this issue Apr 15, 2016 · 5 comments
Open

support for dynamically added elements #47

staabm opened this issue Apr 15, 2016 · 5 comments

Comments

@staabm
Copy link
Contributor

staabm commented Apr 15, 2016

ATM gridforms will search the DOM at javascript-load-time and works with the elements found at init time all the time.

when elements get created via javascript after gridforms was loaded, gridforms will not take them into account.
either gridforms should detect wether elements have been inserted, or it should provide a method which can be called to re-fresh its el.fieldsRows, el.fieldsContainers etc.

at best one could give a parameter into this re-fresh method to make gridforms work inside this newly added elements instead of searching via DOM operations across the whole document.

@kumailht
Copy link
Contributor

So I get the gist of it and I agree. GridForms should know of rows/fields added to the form after the library has been initialized.
What do you think is a good way to do it? (Didn't completely understand what you meant by giving the refresh method a parameter)

@staabm
Copy link
Contributor Author

staabm commented Apr 15, 2016

If we had a method to which we pass a dom reference of a element which has been added to the dom, this method should enhance the markup/add listeners.

The method we have today does not take care that listeners arent appended several times etc

@l-tree
Copy link

l-tree commented May 14, 2018

I see a need for a refresh / re-render function that can be called after elements have been dynamically created, to allow correct calculation, as well as the listening that @staabm mentioned.

@kumailht
Copy link
Contributor

@l-tree Would calling equalizeFieldHeights help?

@l-tree
Copy link

l-tree commented May 15, 2018

@kumailht Is there documentation on what that does? The rendering issues I have include positions of the input elements within data fields, as well as the field widths (they are close to zero)

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

No branches or pull requests

3 participants