I have a Model with LevelInfo property:
public IEnumerable<Tuple<string, string, string>> LevelInfo { get; set; }
In the view I have a JS function:
function fillPath(level, color) {
$('[level=' + level).attr({ 'fill': color });
}
Now I want to iterate through LevelInfo and call fillPath function:
$(document).ready(function() {
@foreach (var info in Model.LevelInfo)
{
// How can I call JS function from here?
// i.e, fillPath(info.Item1, info.Item2)
}
});
Thanks.
fillPathon the server or the client?