Related Items: How to determine when its populated and ready to be read?
Hi..
I'm using a related items control with a lookup field on my form to dynamically filter the related item results.
The setHash function from another thread is working great..
The issue I'm having is that I now want to read some of the fields from the related items row after calling the setHash function but the fd.relatedItems(0).data('ctx').ListData.Row[0].FieldName object is throwing an error saying its undefined or null.
I'm sure its because it hasn't fully completed the filtering process and its just not ready to be read yet.
Is there a callback or property of the related items control that I can look at to determine if the object has been created and is ready to be read?
Thanks a bunch..
TJ
I'm using a related items control with a lookup field on my form to dynamically filter the related item results.
The setHash function from another thread is working great..
The issue I'm having is that I now want to read some of the fields from the related items row after calling the setHash function but the fd.relatedItems(0).data('ctx').ListData.Row[0].FieldName object is throwing an error saying its undefined or null.
I'm sure its because it hasn't fully completed the filtering process and its just not ready to be read yet.
Is there a callback or property of the related items control that I can look at to determine if the object has been created and is ready to be read?
Thanks a bunch..
TJ
Hello tharais,
You can try leveraging MutationObserver object to observe DOM changes inside the Related Items control. With its help, you can check if data is loaded and ready to be used.
Please see the article about MutationObserver for more information.
You can try leveraging MutationObserver object to observe DOM changes inside the Related Items control. With its help, you can check if data is loaded and ready to be used.
Please see the article about MutationObserver for more information.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests