on 04-12-2018 4:18 AM
Hi Expert,
I'm having such requirement whereby I need to display repeated fragment view dynamically as below screen shot. When there is a scenario of 3 blocks is selected, i need to append this fragment view accordingly to the page. The question is how can I retrieve the input dynamically since I'm not providing the element id in the fragment view? The reason I'm not insert the id in the fragment view is due to the view will append dynamically and it will get duplicate id errors if I gives the element id in the fragment view.
I've tried using domfef to get the value but unfortunately I only can get the input field for name and passport number. Relationship field is using select controller and it's not under input field category. Any idea whereby I can retrieve all the inputs dynamically?
$(pageDom).find("input").each(function(index, elem)
Thanks.
Regards,
-Ben-
Hi Ben,
you do not really need a fragment here to fulfill your requirement, you can add a simple form inside a list and bind a model to it, by this you can capture all the data in the model.
here is an example for your reference, where all the dynamic data is stored in the model and fetched when needed.
Note: make sure you add some users before you press "get all data" in the example.
regards
GB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @VAIBHAV GB for the sample reference shared out! It does help me in terms of my app design. I would like to ask your advise what if another way round. For example, I already have the model data stored, how would I be able to populate these model in the dynamic form?
Regards,
-Ben-
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.