vendredi 12 janvier 2018

Checkbox Into Grid.mvc

this is a grid mvc with column checkbox and column save. When the user click save it is possible take value from checkbox column? In this code ther's the set of checkbox from model and render from "o.Confirmation". I want to save the value (checked or unchecked) from page. It is possible use the clickfunction() Javascript for the checkbox? Thank you!!!

 @Html.Grid(Model).Columns(columns =>
{
    columns.Add(m => m.A).Titled("A").SetWidth(50);
    columns.Add(m => m.B).Titled("B").SetWidth(70);
    columns.Add(m => m.C).Titled("C").SetWidth(90);
    columns.Add(m => m.D).Titled("D").SetWidth(90);
    columns.Add(m => m.Confirmation).Titled("E?").Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(o => Html.CheckBox("checked",o.Confirmation));

    columns.Add().Encoded(false).Sanitized(false).SetWidth(25).RenderValueAs(
            @<td style="font-size:large">
            <div>  @Html.ActionLink("Save", "SaveConfirmation", new {id = item.A,confirmation=item.Confirmation})  </div>
            </td>);
}).WithPaging(50);




Aucun commentaire:

Enregistrer un commentaire