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.

Problems when edit Grid rows.

Thread ID:

Created:

Updated:

Platform:

Replies:

132757 Sep 19,2017 11:20 AM Sep 20,2017 08:42 AM JavaScript 1
loading
Tags: ejGrid
noName
Asked On September 19, 2017 11:20 AM

I have app which makes request and get dynamically the columns and after that makes another request for the data.
The Grid is with infinity scroll (when scroll, it loads another data). For the example  pageSize is 10.
If I try to edit each row between 1-10 it works fine, but when I scroll and the grid loads another 10, when I try to edit each of 11 <= row.count I see this error in the console:

ej.web.all.min.js:10 Uncaught TypeError: Cannot read property 'id' of undefined
    at Object.endEdit (ej.web.all.min.js:10)
    at Object._toolbarOperation (....

This is my action for get columns:

public IActionResult GetColumns()
        {
            var data = new[]
               {
                    new { headerText = "ID", field = "id"},
                    new { headerText = "Data", field = "data"},
                    new { headerText = "Value", field = "value"}
                };

            return Json(new { columns = data });

        }
This is the action for get data:

           int count = data.Count();
            var result = data.Skip(dm.Skip).Take(dm.Take);
            return Json(new { result = result, count = count});

This is what returns GetData action (for the example):

{id=21, value = "21", data = "US" },

Getting data works fine.

This is JS:

    var getColumns = ej.DataManager({
        url: "/Home/GetColumns",
        adaptor: new ej.UrlAdaptor()
    });

    var promise = getColumns.executeQuery(new ej.Query()).done(function (data) {


        var dataManager = ej.DataManager({
            url: "/Home/get",
            insertUrl: '/Home/create',
            updateUrl: '/Home/update',
            removeUrl: '/Home/delete',

            adaptor: new ej.UrlAdaptor()
        });
        fields = data.result.columns;
        fields[0].isPrimaryKey = true; // Set id column as primary
        $("#Grid").ejGrid({
            dataSource: dataManager,
            allowScrolling: true,
            allowResizeToFit: true,
            allowReordering: true,
            allowSorting: true,
            allowResizing: true,
            scrollSettings: { height: 200, allowVirtualScrolling: true, virtualScrollMode: "continuous" },
            pageSettings: { pageSize: 10, enableQueryString: true },
            toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] },
            editSettings: { showDeleteConfirmDialog: true, allowEditing: true, allowAdding: true, allowDeleting: true },
            columns: fields
        });
    })
The App loads data fine, but when I try to edit row greather than pageSize (new data loaded), it returns the error.





Venkatesh Ayothi Raman [Syncfusion]
Replied On September 20, 2017 08:42 AM

Hi Customer, 

We are able to reproduce the reported issue and we considered this requirement “Virtual scrolling editing is not working properly and script error thrown” as breaking issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.  
  

 
Regards, 
Venkatesh Ayothiraman 


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.

;