I am try to do this :I want to extract the edited grid data when submit form in action method (below) [HttpPost] public ActionResult Index(Home_MVD h) { if (ModelState.IsValid) { } return View(h); }
Mvc_Ignite_test.rar NOT INCLUDE packages folder ,you can download from 'Manage NuGet packages'thanks in advance...
Hello ticho ticho,
Thank you for posting in our forums!
In order to get the igGrid's edits during a post action, you will need to get the igGrid's transactions and set up a field in the form. When the submit action occurs, you can set the transactions to the field's value. Then, during your post action in the controller you can get the serialized data from the form.
See below the following code changes I have made to your sample that are needed to allow this. If you need further assistance, please let me know and I will be glad to help.
In view markup:
@using (Html.BeginForm()){ @Html.Hidden("gridTransactions") ...
In java script:
$(function () { $("form").submit(function () { var transactions = JSON.stringify($("#grid").igGrid("allTransactions")); $("#gridTransactions").val(transactions); });});
In controller action:
String trans = HttpContext.Request.Form["gridTransactions"];
Thanks.... it works
where i can find the ig grid package like(ig.ui.min.js) and others when i download jquery package there are package not found like ig.ui.min and jquery.custom and more