This is my problem and please let me know if I am approaching it incorrectly. I have a list called "document classes" that holds information such as the retention and revision periods for documents, whether those fields are requried for a particular class, and which department can use those classes. The key piece of information I need from this list is the retentionAmberDays and retentionRedDays for each class as this defines how long before the date a traffic light warning should be displayed.
I want to be able to query all documents in my site collection and highlight documents that have passed these dates, but in order to do this I need to have access to the data values. To do this in other scenarios, I would load the data in an array first via query and then check the array for each item to get the particular value I need.
I think that Search Display Templates are my best bet for building this functionality but the problem is that calling javascript in the tag happens asynchronously and the files are not always loaded before the item rendering logic is processed.
So, how can I load all my javascript files, and run some functions BEFORE the search item rendering logic begins so that the rendering logic can then use that data?
I hope that explanation made sense, reading it back now it seems confusing :-)
Thanks