Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Server-side paging keeps firing up #250

Closed
metalmannight opened this issue Aug 10, 2016 · 1 comment
Closed

Server-side paging keeps firing up #250

metalmannight opened this issue Aug 10, 2016 · 1 comment

Comments

@metalmannight
Copy link

Hi,

I'm using the "onServerSideItemsRequested" solution as found on http://moonstorm.github.io/trNgGrid/release/#/ServerSide.

The problem is that the event keeps firing, so the page keeps getting new info.

basically i've got the grid like

<table class="coms" tr-ng-grid='' fields="vm.allowedFields" order-by="id" selection-mode="SingleRow"
               items='vm.coms' page-items='30' total-items='vm.numberOfRows' current-page='vm.pageNumber'
               on-data-required="vm.onServerSideItemsRequested(currentPage, pageItems)">

and the controller (Typescript) like

onServerSideItemsRequested(currentPage: any, pageItems: any) {
            this.SetGrid(currentPage, pageItems);
        }

and

SetGrid(currentPage: number, pageItems: number) {
                this.comsService.GetData(userId, serviceId, currentPage, pageItems).then(
                    (data: Model.XXX) => {
                        this.coms= data.coms;
                        this.numberOfRows= data.numberOfRows;
                        // I've also tried to set the pagenumber like this.pageNumber = data.pageNumber;
                    });
        }

The onServerSideItemsRequested just keep on triggering ... any thoughts?

@metalmannight
Copy link
Author

Ok, also solved ... Apparently I kept pushing new "allowedfields" on each "get", which in turn kept on firing the onserversideitemsrequested.

Apologies for the false problems!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant