Add rows to DevExtreme grid (angular) - model/schema

alex Source

Adding a row to a devextreme grid (DxDataGridComponent) in row editing mode the grid adds the data to the bind datasource property in this way.

   lenght: 3
>  __proto__: Array(0) [, ...]
>  0: ItemDto {description: "mydescription 1" , ....
>  1: ItemDto {description: "mydescription 2" , ....
>  2: Object {__KEY__: "a64d5gfegfgyv-bfbf....        <--- this is the added row 

The last row (the inserted one) has not a defined type (even if it has the same structure)

So I have to define a schema for the datasource property? did I miss some configuration?


<dxi-column dataField="id" dataType="number"></dxi-column>
<dxi-column dataField="postId" dataType="number"></dxi-column>
<dxi-column dataField="description" dataType="string"></dxi-column>
<dxi-column dataField="quantita" dataType="number"></dxi-column>
<dxi-column dataField="note"></dxi-column>   

[dataSource]="post.postItems" is defined as:

export class PostDto implements IPostDto {
    description: string;
    note: string;
    scadenza: moment.Moment;
    zona: string;
    tipo: PostDtoTipo;
    postItems: ItemDto[];
    isActive: boolean;
    id: number;

export class ItemDto implements IItemDto {
    description: string;
    note: string;
    quantita: number;
    postId: number;
    id: number;


comments powered by Disqus