question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'setPage' method not working

See original GitHub issue

I’m trying to make the table show the first page as default.

Code Example:

// sort table by created column
this.source.setSort([{ field: 'created', direction: 'desc' }]);

// set page 1 as default
this.source.setPage(1);

sorting works as expected but setting the page to 1 not working (table shows the last page). btw, I’m using v1.2.1

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
nateegeekcommented, Jan 14, 2021

This works for me:

setTimeout(() => this.source.setPage(10), 0);

The pagination settings seams to be overwritten, that setTimeout just set your prefered value afterward.

0reactions
sophiecmusicalcommented, Nov 13, 2019

I had the same problem. We we using setPage like this:

this.source.load(data); this.source.setPage(2);

And it was not working. We fixed it setting page also on rowSelect, and it work like a charm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

setPage(index: number) method not working #459 - GitHub
setPage(1) this function will not trigger in case of component lifecycle. Do try it for onClick event it will surely work. I was...
Read more >
SetPage is not a function ERROR while trying to paginate
Your first use of CoinsPagination does not have any prop called page and setPage . import React, { useState, useEffect } from "react"; ......
Read more >
[Solved]-Vue tables 2 setPage method not working after used ...
I think vue-tables.pagination event is not working properly for your code.First of all you have to create one data property which will store...
Read more >
Exceptions with JEditorPane setPage() method (Catching not ...
I got serious exceptions with the JEditorPane()'s setPage() method. I have written the try & catch still i could not catch the exception....
Read more >
JavaScript Pagination - setPage Method | DHTMLX Suite 7 Docs
You can explore the setPage method of Pagination in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found