I’m trying to interact with form inputs inside a search view using $(document).on(‘knack-view-render.view_x’, function(event, view, data) {});
Each input in the form is (i.e. field on the object) is a connection. So when the view is rendered, I make an AJAX call to the connected object (more strictly to a view containing the connected object) to get back more information about each “option”, specifically an image to be added for illustrative purpose.
The AJAX call runs smoothly, and I easily get the required images back, however, when when I query the DOM to find each input (based on the “value” - which is the connected record’s ID) so that I can insert the image, the inputs are not present/available yet!
As far as I can tell, when “knack-view-render.view_x” fires, the view (or form within the view) has not actually finished rendering yet, making it impossible to find the elements I’m looking for!!
Is this true, and if so, what can I do? Is there an event that fires later, when the form has indeed completed loading / rendering?
Otherwise, what (assumedly idiotic) mistake am I making?
TIA!