This is a migrated thread and some comments may be shown as answers.

Adding a new record in a child datasource results in duplicate parent source when bound to view

1 Answer 127 Views
Hierarchical Data Source
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 10 Nov 2017, 04:02 AM

Dojo demonstrating the issue: https://dojo.telerik.com/@ian+telerik@ocucom.com/EBeDE

When using a HierarchicalDataSource bound to a viewModel, using any method to insert a new row in a child datasource results in a duplicate top-level item in the bound HTML view, until the "change" event is manually triggered on the parent. 

My goal is putting together a hierarchical product editor (for, say, departments and employees; some hierarchy where the children are of differing object types to the parent). 

 

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 13 Nov 2017, 12:25 PM
Hello Ian,

The described behavior is designed so. The idea behind that is that when there batch editing, multiple items to be edited, but only once change event is triggered, the HierarchicalDataSource to traverse through all items and process the data. 

In order to accomplish an automatic processing on each command you can enable the autoSync optionhttps://dojo.telerik.com/EFuHum

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Hierarchical Data Source
Asked by
Ian
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or