0

I have a page in which i want to give the users the option to go to a particular page .

The default pagination is there which enables the user to traverse in the range of 5 pages .

But i want to give an option to switch to any page_number that they input in an input text field .

I have tried using t.fnPageChange(page_number) , but this gives me this error .

enter image description here

2
  • can you show an example link so that we can check and let you know Commented Feb 22, 2017 at 10:51
  • Sourav Prem check the answers below Commented Feb 22, 2017 at 11:23

1 Answer 1

2

According to the datatables API, you may want to use page instead of fnPageChange; if you extracted page_number from a textfield, it will probably be a string, and the library is trying to interpret it as an action instead of a number.

Remember to transform the page into an integer before passing it to page():

int_page_number = parseInt(page_number);
t.page(int_page_number);
Sign up to request clarification or add additional context in comments.

1 Comment

In my case i had to change it to Number(x) . Then it worked fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.