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.

Cannot read property result of undefined

Thread ID:

Created:

Updated:

Platform:

Replies:

120004 Aug 21,2015 02:01 PM Aug 24,2015 10:06 AM ASP.NET MVC 1
loading
Tags: Grid
David Elies
Asked On August 21, 2015 02:01 PM

When trying to create a Grid, I get an error in the Javascript and it doesn't load any data.  It says Cannot read property result of undefined.  This error is in the ODataAdapter.processResponse function.  It has an argument i which is the OData response from my server, but then it tries to read property d from object i.  The error occurs on this line (from the .min.js file: 

var p = u._requiresCount ? i.d.result : i.d, l, a, b, nt, k, tt, g, h;

This seems like a typo, or a problem with minification, since the OData response clearly doesn't contain the property d.

Gowthami V [Syncfusion]
Replied On August 24, 2015 10:06 AM

Hi David,

Thanks for using Syncfusion products.

We have analyzed the reported issue and considered this requirement “Script error thrown when the response in light format in OData adaptor” as bug 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.


We can resolve the above issue by using a custom adaptor which is extended from ODataAdaptor and for accessing the light format data in the processResponse of the CustomAdaptor as follows.



$(function(){

        var customAdaptor = new ej.ODataAdaptor().extend({

            processResponse: function(data){

                var result = data["value"];

                var count = data["odata.count"];

                return count == null ? result : { result: result, count: count};

            }

        });

function load(args) {

this.model.dataSource.adaptor = new adaptor();

}

});


@(Html.EJ().Grid<object>("FlatGrid")

. . . .

}).ClientSideEvents(eve => { eve.Load("load"); })


)




Please refer the below link for more clarification about the CustomAdaptors.

http://help.syncfusion.com/ug/aspnetmvc/index.html#!Documents/dataadaptors.htm



Regards,


Gowthami 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.

;