简体   繁体   中英

Kendo Ui Angular2 Grid Paging to first page

I have grid with few pages, When Im resfreshing data I want to go back to the first grid page by code.

my grid:

               <div class="chapterContent">
                    <div class="row k-rtl clearfix">
                        <kendo-grid [data]="gridView"
                                    [pageSize]="pageSize"
                                    [skip]="skip"
                                    [pageable]="{
                                                    buttonCount: buttonCount,
                                                    info: info,
                                                    type: type,
                                                    previousNext: previousNext
                                                  }"
                                    [scrollable]="'none'"
                                    [height]="260"
                                    [rowHeight]="36"
                                    (pageChange)="pageChange($event)"
                                     [selectable]="true"
                                    (selectionChange)="onSelectChange($event)" >
                            <kendo-grid-column field="CHAPTER_DESCRIPTION" title="mmm" width="10" headerClass="sectionTitle">
                            </kendo-grid-column>
                            <kendo-grid-column field="LineBasicSum" title="סכום" width="10" headerClass="sectionTitle">
                            </kendo-grid-column>
                            <kendo-grid-column field="WORK_TYPE_DESCRIPTION" title="mmm" headerClass="sectionTitle" width="10">
                            </kendo-grid-column>
                            <!--<kendo-grid-column  title="mmm"  width="10">
                                <template kendoCellTemplate let-dataItem let-rowIndex="rowIndex">
                                    <button class="btnLink" (click)="onChapterClick(dataItem)" title="פצל"><span class="glyphicon glyphicon-import" aria-hidden="true"></span></button>
                                </template>
                            </kendo-grid-column>-->
                        </kendo-grid>
                    </div>
                </div>

How can I return to the first grid page?

thanks,

It depends on how you have implemented the paging, generally speaking it should be something like this:

public onClick() {
    this.pageChange({skip: 0})
}

http://plnkr.co/edit/KlWJYRmvZ9hJMD00jNg8?p=preview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM