We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Pass the Updated EjGrid Values to the controller using ajax.

Thread ID:

Created:

Updated:

Platform:

Replies:

118821 Apr 13,2015 05:13 AM Apr 14,2015 10:50 AM JavaScript 1
loading
Tags: ejGrid
Ganga
Asked On April 13, 2015 05:13 AM

Hi, 
       I am using EjGrid with dropdown column which is not editable in normal editing mode.so i m using batch edit mode.after editing all the rows i want to update them in database.so i am passing the grid values to controller.But i didn't get the updated values in controller.Here is my ajax code to pass the grid values to controller



  $('#SaveGrid').click(function () {

            var gridObj = $("#Grid").ejGrid("model");
            alert(gridObj);
            var G1 = JSON.stringify(gridObj);
            alert(G1);
      })

i want to pass the updated grid values to the controller in an external button click. and i didn't use the toolbar for this grid.

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 14, 2015 10:50 AM

Hi Ganga,

Thanks for using Syncfusion Products.

Your requirement have been achieved by the batchSave public api in ejGrid. In button click event we suggest you to invoke batchSave method. While using batchSave method it will pass the updated grid values to the controller.

Please find the below code snippet :



<script type="text/javascript">

$("#button").ejButton({

click: function (args) {

var grid = $("#FlatGrid").ejGrid("instance");

grid.batchSave();

}

});

</script>

For your convenience we have created a sample and sample can be downloaded from the below link

Sample Link : http://www.syncfusion.com/downloads/support/forum/118821/Sample2116279786.zip

Please let us know if you have any further assistance.

Regards,

Prasanna Kumar N.S.V


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;