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

how to load forieng key from OrdersTable, in angular grid, and save in different table

Hello, I have three tables, I need to save data in two table, when a customer makes a return in a tree grid/grid or hierachical grid (it does not matter which one, easiest is good :)
  1. CustomersTable, ID, name  
  2.    OrdersTable. ID, name, customerID, total, WasReturned
  3.     CustomerOrdersReturnsTable -  Id, OrderID,  CustomerID, OrderAmount, to track, save and load return and amount

Use case: In my Orders table, I am both loading & creating new orders & customer Returns.
   OrderTable Order In line Form
  < form>  [OrderId, address,  ....   customerID Foreign Key, OrderAmount ]

Question:
 When we edit the order table in hierachical/treegrid/grid in the order table,
1) How can I load Customer names from CustomersTable,
2) How to save update both orderTable form (during customer return), and also save customerID Foreign Key, OrderAmount in
CustomerOrdersReturnsTable


Another request... in the EJ2 angular demos, please add sample ASP web API tab also to help use understand the API side

4 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team July 15, 2019 12:01 PM UTC

Hi Tavis, 

Thanks for contacting Syncfusion support. 

From your query, we suspect that you want use our hierarchical Grid feature to show and edit your relational table data’s. So, please confirm the below details for further assistance, 

  1. Do you want to render the OrdersTable as a childGrid of CustomersTable (i.e parent Grid -> child Grid1)?
  2. Do you want to render the CustomerOrdersReturnsTable as the childGrid of the OrdersTable (i.e child Grid1 -> child Grid2)?
  3. Do you want perform CRUD operation in all of these Grids (i.e parent Grid -> child Grid1 -> child Grid2)?

Please refer the below demo and documentation to know more details about our hierarchical Grid feature, 



If we misunderstood your query, please share more details about your requirement to us. This will help us to provide a better suggestion for your requirement as early as possible. 

Regards, 
Seeni Sakthi Kumar S. 



TR Trav July 16, 2019 03:42 PM UTC

Hello, I am sorry I don't know the different names of your controls.

To clarify, yes# 3, I want to perform CRUD in all 3 tables and persist the data with Foreign Key, including updating the parent relationships correctly.

Within this sample if you can highlight and explain how I can apply this same mechanism to other similar objects and hierarchy it would be greatly helpful. In particular how look up foreign key data like Customer names etc.

thanks


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team July 17, 2019 01:34 PM UTC

Hi Trav, 

Thanks for the update. 

We have validated your requirements and logged the task to create a custom sample with your requirement. Currently we are working on this and we will provide the sample on July 19, 2019. Until then we appreciate your patience.  

We will create the sample by considering the following scenario, 

  1. Need to create a hierarchical Grid (Parent Grid -> child Grid1 -> child Grid2).
  2. Need to use webApi service to provide a datasource to these Grids.
  3. Need to perform CRUD actions for all of these three Grids.
 
If you have any concern in this scenario, please inform to us. 

Regards, 
Seeni Sakthi Kumar S. 



SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team July 19, 2019 10:46 AM UTC

Hi Trav, 

Thanks for the patience. 

We have prepared a custom sample by handling the CRUD actions of the hierarchical Grid in WebApi service. And, we have attached the prepared sample in the below link for your reference, 


Please get back to us if you have any concern in this sample. 

Regards 
Seeni Sakthi Kumar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon