I am passing a list of objects from my controller to my page , on loading of my page i want to invoke a javascript function on each of the element in the list coming from the controller .. HOW can i achieve that , i know i cannot mix and match javascript and ${}(g-strings) , so i dont have any idea. pls help
code: from controller , the DurationTable contains expiry a date field in itself
def test = {
[durationTablelist: DurationTable.list()]
}
code on gsp ::
jQuery(document).ready(function() {
var counter = 0;
var myarraylist = new Array();
myarraylist = "${durationTablelist}";
for(counter=0;counter<"${durationTablelist.size()}";counter++){
// call some function on each of the element in the list passed from controller
dont know what to write here..
}