Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pagination function to trigger next page#290

Unanswered
cooperRjp asked this question inQ&A
Discussion options

I need to build a function that automatically changes page every few seconds, does anyone know if there is a hook to call next page on the pagination component, I'm using it within CDataTable.

You must be logged in to vote

Replies: 1 comment

Comment options

This is what I ended up with not ideal, I tried using the activePage prop which I think would be cleaner but that only changed the pagination number but not the data on the table.

const pagination = useRef()    useEffect(() => {        const nextButton = pagination.current.querySelector('[aria-label="Go to next page"]');        const next = () => setInterval(() => {            nextButton.click()        }, 10000)        next()    }, []);
<CDataTable      items={orderLineList}      fields={fields}      addTableClasses={""}      itemsPerPage={10}      hover      loading={loading}      pagination={{ innerRef: pagination }} />

If anyone can come up with a better solution please let me know.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@cooperRjp

[8]ページ先頭

©2009-2025 Movatter.jp