I have a Kendo UI grid made with Angular 2 .It's part of a crud application ,where I have a delete button .After the delete I want the grid to refresh automatically.
This is the grid that shows the event's notifications :
<kendo-grid [data]="EventsNotificationSetup">
<kendo-grid-command-column title="" width="200">
<template >
<button (click)="EditModal.open()" kendoGridEditCommand kendoButton [icon]="'pencil'">Edit</button>
<button (click) = deleteEventNotification(dataItem.id) kendoGridRemoveCommand kendoButton [primary]="true" [icon]="'trash'">Remove</button>
</template>
</kendo-grid-command-column>
</kendo-grid>
This the delete code where I literally deleted the record :
this._http.delete(this.link + notificationId,
{
headers: new Headers({
'Content-Type': 'application/json'
})
})
.map(res => res.json()).subscribe();
After this I made again an http.get to get the event notifications but it does not update automatically the grid,I have to refresh the page.
Do you know how can I refresh the grid?
Thanks!
You could remove this item from EventsNotificationSetup in success handler of delete subscription and because of two-way data binding your grid will be updated as I remember correctly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With