Getting javascript variable in Scala -
i'm trying use varible javascript in scala array.
need objects list.
entrytype scala list.
var options = ""; (t = 0 ; t < @entrytypes.size(); t++) { @defining('t') { => alert(@i) options += "<option value='0'selected='selected'>@entrytypes(i).title</option>"; } }
the thing can't access t, if try put @defining(t' { i=>
not scala variable.
should do?
try this:
var options = ""; var entrytypes = @{html(json.stringify(json.tojson(entrytypes)))}; (t = 0 ; t < entrytypes.length; t++) { alert(t); options += "<option value='0'selected='selected'>" + entrytypes[t] + "</option>"; } }
Comments
Post a Comment