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. Image for the cookie policy date
close icon

Childgrid and WebApi Odata v4

Dear,
In the master I want to have the list of groups, and in details all users in that particulary Group, I attached my source.I'm having troubles using childgrid and odata v4 webapi both to retrieve master & childs data.
In the master I want to have the list of groups, and in details all users in that particulary Group, I attached my source.

Attachment: ex2_be6f2882.zip

3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team July 19, 2016 12:35 PM UTC

Hi Andrea, 

Thanks for contacting Syncfusion support.   
  
We created a sample in Hierarchy Grid with odataV4adapter and we did not face any issues while using childgrid.   
  
Please find the code example and sample:   


var dm = ej.DataManager({ url: "/odata/Employee", adaptor: new ej.ODataV4Adaptor() }); 
 
    var dataManager = ej.DataManager({ 
        url: "/odata/Order", 
        adaptor: new ej.ODataV4Adaptor() 
    }); 
 
    $(function () { 
        $("#FlatGrid").ejGrid({ 
            dataSource: dm, 
            ------------------------------ 
           columns: [ 
                   ------------------------------- 
           ], 
            childGrid: { 
                dataSource: dataManager, 
                queryString: "EmployeeID", 
                allowPaging : true, 
                columns: [ 
                  ----------------------------------- 
               ], 
            }, 
 
        }); 
    }); 
</script> 


Try the above sample and if you still face any trouble, please provide the following details.   

1. If you face any exception or console error, Share the stackrace of the exception  

2. In the code example, you are using custom adapter. But, we did not found the extension of custom adapter. So, please confirm the type of adapter used in your sample  

3. Code example of a controller.  

4. Essential Studio Version details. 

Regards, 
Prasanna Kumar N.S.V 
 



AP Andrea Perazzolo July 19, 2016 02:01 PM UTC

Dear,
please note that I want to navigate from Group to Users with a Many-To-Many relation.
The customAdapter is the one that you give me for updating entries with PATCH instead of PUT (you can find it in the Scripts folder), I attached my full code.
With you childgrid mechanism I cannot navigate for example the odata url "/odata/Groups(3)/Users" that lists all users in group with ID = 3.

Thanks in advance.
Kind regards,
Andrea.

Attachment: THEasy_3a9103bf.zip


PK Prasanna Kumar Viswanathan Syncfusion Team July 20, 2016 04:58 PM UTC

Hi Andrea, 

Before proceed with your requirement confirm the below details, 

1. Provide the JSON structure of datasource used for the child grid. In this update the url for the child grid we found that you have passed with ID values. So, please confirm with below JSON structure that you are used for the child grid. 


"[{"Name":"Jim","Skills":["C++","Java","Painting"]},{"Name":"Joe","Skills":["INT","",""]}]" 
  

Regards, 
Prasanna Kumar N.S.V 


Loader.
Live Chat Icon For mobile
Up arrow icon