From 876bb1f271cc6f589e136bcdc1a16fcebca096a7 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 10 Nov 2023 19:24:28 -0500 Subject: [PATCH] chore: prefer `useCursor` instead of deprecated `isWithCursor` --- src/examples/slickgrid/Example25.tsx | 2 -- src/examples/slickgrid/Example6.tsx | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/examples/slickgrid/Example25.tsx b/src/examples/slickgrid/Example25.tsx index 60b03f2b..adf69651 100644 --- a/src/examples/slickgrid/Example25.tsx +++ b/src/examples/slickgrid/Example25.tsx @@ -35,7 +35,6 @@ interface Props { } interface State extends BaseSlickGridState { metrics?: Metrics; graphqlQuery: string; - isWithCursor: boolean; processing: boolean; selectedLanguage: string; status: Status; @@ -65,7 +64,6 @@ export default class Example25 extends React.Component { this.state = { gridOptions: undefined, columnDefinitions: [], - isWithCursor: false, graphqlQuery: '', metrics: undefined, processing: false, diff --git a/src/examples/slickgrid/Example6.tsx b/src/examples/slickgrid/Example6.tsx index 4a254afa..deaf19f5 100644 --- a/src/examples/slickgrid/Example6.tsx +++ b/src/examples/slickgrid/Example6.tsx @@ -215,7 +215,7 @@ class Example6 extends React.Component { field: 'userId', value: 123 }], - isWithCursor: this.state.isWithCursor, // sets pagination strategy, if true requires a call to setPageInfo() when graphql call returns + useCursor: this.state.isWithCursor, // sets pagination strategy, if true requires a call to setPageInfo() when graphql call returns // when dealing with complex objects, we want to keep our field name with double quotes // example with gender: query { users (orderBy:[{field:"gender",direction:ASC}]) {} keepArgumentFieldDoubleQuotes: true @@ -395,13 +395,13 @@ class Example6 extends React.Component { setIsWithCursor(newValue: boolean) { this.setState((state: State) => ({ ...state, isWithCursor: newValue })); - this.resetOptions({ isWithCursor: newValue }); + this.resetOptions({ useCursor: newValue }); return true; } private resetOptions(options: Partial) { const graphqlService = this.state.gridOptions!.backendServiceApi!.service as GraphqlService; - this.reactGrid.paginationService!.setCursorBased(options.isWithCursor!); + this.reactGrid.paginationService!.setCursorBased(options.useCursor as boolean); this.reactGrid.paginationService?.goToFirstPage(); graphqlService.updateOptions(options); this.setState((state: State) => ({