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.

TypeError: this.model.currentViewData is undefined (In Implimentation of Hierarchical Grid --> Child Grid)

Thread ID:

Created:

Updated:

Platform:

Replies:

132591 Sep 11,2017 04:59 AM Sep 14,2017 12:52 AM ASP.NET MVC 3
loading
Tags: Grid
Saud Nasir
Asked On September 11, 2017 04:59 AM

Hi
I am implementing a Hierarchy Grid in ASP.Net MVC using syncfusion Grid Control. I am following the example of this article. 
https://www.syncfusion.com/kb/6316/how-to-pass-parentkey-from-parent-to-childgrid
I am fetching the data from server side with an ajax call on the expansion of child grid. When i try to expand child grid, the ajax call fetches the data in JSON format and a JavaScript error (TypeError: this.model.currentViewData is undefined) occurs and data in the child grid doesn't load into child grid. I have attached sample project with this query. The URL for accessing the required page is (http://localhost:50364/Grid/GridFeatures). *Port Number after localhost will be different on your machine.

Any help is appriciated

Thanx
Saud :)


Attachment: SynFusionPractice_661232df.zip

Mani Sankar Durai [Syncfusion]
Replied On September 12, 2017 08:59 AM

Hi Saud, 

Thanks for contacting Syncfusion support. 

We have checked the sample and we are able to reproduce the reported issue. From the sample provided we found that you have returned the result alone from server side instead of passing it as result and count pair. When using UrlAdaptor it is must to return the data as result and count pair.  So that it will bind the data to the grid.  
Refer the code example 
public JsonResult GetChildData(int _empID) 
        { 
            var ChildDaqtaSource = ChildData(_empID); 
            var count = ChildDaqtaSource.Count; 
            return Json(new { result = ChildDaqtaSource, count = count });  //pass it as result and count pair 
         } 

We have also modified a sample that can be downloaded from the below link. 
Refer the documentation link of UrlAdaptor 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


Saud Nasir
Replied On September 13, 2017 12:39 AM

Hi Mani,

Solution worked. Thanx :)


Mani Sankar Durai [Syncfusion]
Replied On September 14, 2017 12:52 AM

Hi Saud, 

We are happy to hear that your problem has been solved.  

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


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.

;