I could not add EDIT button on my application (seems to be broken - foreach)
I could not add EDIT button on my application (seems to be broken - foreach)
I decided to use a DATATABLE but i could not make it work on my previous model, everything works just fine but the EDIT button is not even working. Dont want to use AJAX or something like that, just the information retrieved in my FOREACH
This is my code (do NOTE that i used a foreach):
@model IEnumerable<WebApplication.Models.Approval>
@{
ViewData["Title"] = "Approvals";
}
Approvals
@Html.DisplayNameFor(model => model.CODE) | @Html.DisplayNameFor(model => model.EMAIL) | @Html.DisplayNameFor(model => model.FIRSTNAME) | @Html.DisplayNameFor(model => model.LASTNAME) | |
---|---|---|---|---|
@Html.DisplayFor(modelItem => item.CODE) | @Html.DisplayFor(modelItem => item.EMAIL) | @Html.DisplayFor(modelItem => item.FIRSTNAME) | @Html.DisplayFor(modelItem => item.LASTNAME) | @Html.ActionLink("EDIT", "Edit", new { id = item.code }) |
How should i create my JS script in order to make it work?Can help me?
I was thinking about something like this:
Answers
I'm not sure what your template code is building but here is a basic example with buttons in the table rows:
http://live.datatables.net/xijecupo/1/edit
It relies on using delegated events as described in this example.
Kevin