簡體   English   中英

如何刷新Angular 2中的Kendo UI網格?

[英]How can I refresh the Kendo UI grid in Angular 2?

我有一個用Angular 2制作的Kendo UI網格。它是一個crud應用程序的一部分,我有一個刪除按鈕。刪除后我希望網格自動刷新。

這是顯示事件通知的網格:

<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._http.delete(this.link + notificationId,

            {
                headers: new Headers({
                    'Content-Type': 'application/json'
                })
            })
            .map(res => res.json()).subscribe();

在此之后,我再次制作一個http.get來獲取事件通知,但它不會自動更新網格,我必須刷新頁面。

你知道怎么刷新網格嗎?

謝謝!

您可以從刪除訂閱的成功處理程序中的EventsNotificationSetup中刪除此項目,並且由於雙向數據綁定,您的網格將更新,因為我記得正確

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM