Skip to content

Commit

Permalink
fix: share view lack search relative params
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxing9 committed Nov 20, 2024
1 parent 3d24e8a commit 2029574
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const GridViewBase = (props: IGridViewProps) => {
const hiddenFields = useHiddenFields();
const customIcons = useGridIcons();
const { openTooltip, closeTooltip } = useGridTooltipStore();
const { setGridRef } = useGridSearchStore();
const { setGridRef, searchCursor } = useGridSearchStore();

const prepare = isHydrated && view && columns.length;
const { filter, sort } = view ?? {};
Expand Down Expand Up @@ -126,7 +126,7 @@ export const GridViewBase = (props: IGridViewProps) => {
};
}, [filter, sort?.sortObjs, viewQueryWithGroup]);

const { recordMap, groupPoints, onVisibleRegionChanged } = useGridAsyncRecords(
const { recordMap, groupPoints, onVisibleRegionChanged, searchHitIndex } = useGridAsyncRecords(
ssrRecords,
undefined,
viewQuery,
Expand Down Expand Up @@ -254,6 +254,8 @@ export const GridViewBase = (props: IGridViewProps) => {
columnStatistics={columnStatistics}
freezeColumnCount={isTouchDevice ? 0 : 1}
columns={columns}
searchCursor={searchCursor}
searchHitIndex={searchHitIndex}
customIcons={customIcons}
rowControls={rowControls}
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const SearchCountPagination = forwardRef<
return finalResult;
} else {
const result = await previousFn(baseQueryRo);
result &&
result?.data &&
result.data?.forEach((result, index) => {
const indexNumber = skip + index + 1;
finalResult[indexNumber] = result;
Expand All @@ -191,7 +191,7 @@ export const SearchCountPagination = forwardRef<
if (nextCursor <= totalCount) {
const skip = currentPage - 1;
const result = await nextFn({ ...baseQueryRo, skip });
result &&
result?.data &&
result.data?.forEach((result, index) => {
const indexNumber = skip + index + 1;
finalResult[indexNumber] = result;
Expand Down

0 comments on commit 2029574

Please sign in to comment.