I have a form that has a collection that includes the ability for the approver to approve or reject each row in the collection individually. Based on what they pick it updates the row color to green if approved and red if rejected.
This part is working great during the actual approval process however the color changes are not being shown when viewing the previous instances or when it is saved to Laserfiche. Here is an example of a submitted form that properly showed the row as red when it was rejected but does not show that color when viewing the instance via Instances or My History.
And here is what it looks like in Laserfiche where it also does not show the proper row color.
Here is my code where collection is the class for the collection and approved is the class for the approval dropdown. By the way, a big thanks to Scott Wilson for helping with the code to make the color change!
$(document).ready(function () { $('.collection').on('blur', 'select', colorchange); $('.collection').on('click', colorchange); $('.collection').on('change', colorchange); $('.cf-collection-append form-q').on('click', colorchange); colorchange(); function colorchange(){ $('.cf-collection-block ul').each(function () { $(this).find('.approved select').each(function () { switch($(this).val()){ case "Approved": $(this).closest('div.form-q').css('background-color','#ccffcc'); break; case "Rejected": $(this).closest('div.form-q').css('background-color','#ffcccc'); break; default: $(this).closest('div.form-q').css('background-color','transparent'); break; } }); }); } });