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

Refresh grid when using remote binding directive

2 Answers 751 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chau
Top achievements
Rank 1
Chau asked on 20 Mar 2018, 06:09 PM

I have a grid  using the custom remote binding directive, and filtering, sorting work fine via the directive productsBinding rebind().

<kendo-grid #productgrid

                    productsBinding
                    [height]="450"
                    [resizable]="true"
                    [filterable]="true"
                    [filter]="state.filter"
                    [sortable]="true"
                    [sort]="state.sort"
                    [pageSize]="state.take"
                    [pageable]="true"
                    [skip]="state.skip"
                    [selectable]="true">

 <ng-template kendoGridToolbarTemplate>
                <table class="k-grid-ignore-click">
                    <button kendoButton [icon]="'myspace'" style="color:blue;" 
                            (click)="openPayorDeptDialog()" >
                        Select Payor/Dept
                    </button>
                </table>
            </ng-template>

 

2 Answers, 1 is accepted

Sort by
0
Chau
Top achievements
Rank 1
answered on 20 Mar 2018, 06:17 PM

In the kendoGridToolbarTemplate, I have a button action to open a popup dialog which upon closing, should commit some data change and refresh the productgrid.

If the grid was bound to local data, I could call the method process(data, gridstate), but since this is a remote binding directive, I am not sure how to invoke the grid to rebind.

Thanks for any suggestion.

 

0
Dimiter Topalov
Telerik team
answered on 22 Mar 2018, 11:31 AM
Hello Chau,

When a custom binding directive is used, you can obtain a reference to this directive via ViewChild and call its rebind() method when necessary in your custom handler, e.g.:

https://plnkr.co/edit/24SS20NHPttrVwWOos3S?p=preview

The example above demonstrates calling the rebind() method upon a button click, but you can do the same in the handler of the custom Dialog's close event.

I hope this helps.

Regards,
Dimiter Topalov
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
General Discussions
Asked by
Chau
Top achievements
Rank 1
Answers by
Chau
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or