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

Get complex data (JSON) out of Batch-save


when I have a complex column structure like in the Image, the output is still flat like:


how do i get the correct structure like defined in the columns?


1 Reply

PS Pavithra Subramaniyam Syncfusion Team December 12, 2019 08:55 AM UTC

Hi Dennes, 
Greetings from Syncfusion support. 
By default the entered data will be mapped to the format in which the “column.field” has been defined. In your sample we suspect that you have a simple column field (without the dot operator) which might be the cause of the behavior. So if you want the complex structure you need to define the column field with dot(.) operator. Please refer to the below code example, documentation link and sample link for more information. 
    selector: 'app-root', 
    template: `<ejs-grid #batchgrid id='Batchgrid' [dataSource]='data' allowPaging='true' (beforeBatchSave)="beforeBatchSave($event)" [pageSettings]='pageSettings' 
    [editSettings]='editSettings' [toolbar]='toolbar'> 
      <e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' type="number" 
      <e-column headerText='Order Details' [columns]='orderColumns'></e-column> 
export class AppComponent { 
    public ngOnInit(): void { 
        this.orderColumns = [ 
                field: 'Order.CustomerID', 
                headerText: 'Customer ID', 
                width: 130, 
                textAlign: 'Right', 
                field: 'Order.Freight', 
                headerText: 'Freight ($)', 
                width: 120, 
                format: 'C1', 
                textAlign: 'Right', 
Please get back to us if you need further assistance. 

Pavithra S  

Live Chat Icon For mobile
Up arrow icon