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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using updateRecord with Batch Edit mode

Thread ID:





120831 Oct 20,2015 04:01 PM UTC Oct 21,2015 08:58 AM UTC JavaScript 1
Tags: ejGrid
Asked On October 20, 2015 04:01 PM UTC

Hi Team,

I have a grid that uses batch edit mode and button that uses updateRecord for the said grid. The problem is getting the new data that is updated both using the updateRecord function and updates from user input.  If I use a batchSave and getCurrentViewData the data that I get are only those changes made by the user as if the data from the updateRecord is disregarded. If I check the data using getBatchChanges, it would show the former data of the record where updateRecord was used.
Original Data
PKId = 1
ShipQty = 1
Unit = "PACK"
Factor = 25
OrigQty = 25
Description = "Jevity"

function UpdateRecord(pkId){
 $("#ShipmentGrid").ejGrid("updateRecord", "PKId", {
        "PKId": pkId,      
        "ShipQty": 5,
        "Unit": "CASE",
         "Factor": 5,
         "OrigQty": 25,
        "Description": "Jevity",

Then user changed ShipQty to '7'

Data Displayed on Grid:
PKId = 1
ShipQty = 7
Unit = "CASE"
Factor = 5
OrigQty = 25
Description = "Jevity"

var grid = $("#ShipmentGrid").data("ejGrid");
var shipData = grid._currentJsonData;  <--- at this point ShipQty = 5, Unit = 'CASE'

var grid = $("#ShipmentGrid").data("ejGrid");
 var shipData = grid._currentJsonData;   <--- at this point ShipQty = 7 but Unit = 'PACK'

What I need to get from shipData is the one that is on display, that is ShipQty = 7, Unit = 'CASE'

Is there a way to simply get the data that is displayed on the grid? or update the record that would reflect after a batchSave?


Sellappandi Ramu [Syncfusion]
Replied On October 21, 2015 08:58 AM UTC

Hi Lory,

Thanks for contacting Syncfusion support.

We can get only the modified data before batchSave using getBatchChanges(). After batchSave, we can get the current data using getCurrentViewData().

Please refer to the code example and sample for your requirement,

    <button id="CellChange">Current value</button>

    <div id="Grid"></div>

    <script type="text/javascript">

        $(function () {


                dataSource: window.gridData,

                allowPaging: true,


                columns: [





                click: "UpdateRecord",



        function UpdateRecord() {

            $("#Grid").ejGrid("updateRecord", "OrderID", {

                "OrderID": 10248,

                "CustomerID": "Tomps",

                "EmployeeID": 3,

                "Freight": 5,

                "ShipName": "Toms Speziliation",

                "ShipCountry": "Itally",


obj = $("#Grid").ejGrid("instance");

obj._bulkEditCellDetails._data = $.extend(true, [], obj.getCurrentViewData());//Setting the data from currentViewData for data reflect in edit form


Sample: http://jsplayground.syncfusion.com/ysjkpxvj

In the above sample, we have used Update button to update the dynamic data in grid. After the date updated, we can get the current page data using getCurrentViewData() or model.currentViewData.

Sellappandi R


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon