I have have following line that is working correctly:
html: "<td>" + goalcard.Name + "</td><td>" + goalcard.Customer + "</td><td>" + goalcard.PlannedDate + "</td><td>" + goalcard.CompletedDate + "</td>"
When I try this I get my JSON displayed.
html: "<td>" + goalcard.Name + "</td><td>" + goalcard.Customer + "</td><td>" + goalcard.PlannedDate + "</td><td>" + goalcard.CompletedDate + "</td><td>" + @Html.ActionLink("Ändra", "Edit") | @Html.ActionLink("x", "Inactive", new { @class = "deleteLink" }) + "</td>"
I also recieve a bunch of errors such as:
- 'return' statement outside of function'
- Expected ';'
- Syntax error
- Expected identifier or string
Am I doing something wrong here?
This is the complete function:
result.forEach(function (goalcard) {
$("#GoalcardSearchResult tbody").append(
$('<tr/>', {
click: function() {
id = goalcard.Id;
var url = '@Url.Action("AnswerForm", "AnswerNKI", new { id = "__id__"})';
window.location.href = url.replace('__id__', id);
},
// steg Create a row for each result
html: "<td>" + goalcard.Name + "</td><td>" + goalcard.Customer + "</td><td>" + goalcard.PlannedDate + "</td><td>" + goalcard.CompletedDate + "</td><td>" + @(Html.ActionLink("Ändra", "Edit")) | @(Html.ActionLink("x", "Inactive", new { @class = "deleteLink" })) + "</td>"
}));
});
$('#GoalcardSearchResult tbody').trigger("update");
$("#GoalcardSearchResult").tablesorter();
});
return false;
Thanks in advance!