3 Replies - 274 Views - Last Post: 17 April 2017 - 11:26 AM

#1 daymaker  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 11-February 17

Disable Previous and Next button on 1st and last page not working

Posted 17 April 2017 - 05:48 AM

I've 2 pop-ups to display the user list & admin list which would display 10 results per page, which is working fine.

I'm getting the page nos. from the java servlet in the JSON.

Note: There are 2 parameters passed in the url - resType and pageNo.
pageIndex returns 0, 10, 20 ...(multiples of 10).
result: checks what sort of result I want. You can ignore this part.

So my url in the createTable function looks something like this instead -

''/abc/myData.json?result="+resType+"&pageIndex="+pageNo

In my case(for the url I'm using), the previous & next buttons are getting hidden completely. But over here, it seems to be working fine.

What should I update in my code to make it work perfectly fine for my url as well?

JSfiddle JSFiddle

Is This A Good Question/Topic? 0
  • +

Replies To: Disable Previous and Next button on 1st and last page not working

#2 ArtificialSoldier  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1787
  • View blog
  • Posts: 5,697
  • Joined: 15-January 14

Re: Disable Previous and Next button on 1st and last page not working

Posted 17 April 2017 - 08:14 AM

I'm not clear what you want to change. The buttons get hidden, and you want to just disable them instead? If that's not what you're trying to do, what is it?
Was This Post Helpful? 0
  • +
  • -

#3 daymaker  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 11-February 17

Re: Disable Previous and Next button on 1st and last page not working

Posted 17 April 2017 - 08:49 AM

View PostArtificialSoldier, on 17 April 2017 - 08:14 AM, said:

I'm not clear what you want to change. The buttons get hidden, and you want to just disable them instead? If that's not what you're trying to do, what is it?

What I need to achieve is, the previous button should be only disabled & hidden in the first page. Similarly, the next button should be only disable & hidden in the last page.

In the fiddle link, I've provided with a randomuser.api url,where it works fine.
But I'm using a different url which is an internal one, and can't share here.
However, I've explained the parameters of my url in the question earlier. In my actual url, it doesn't work as mentioned above.
Was This Post Helpful? 0
  • +
  • -

#4 ArtificialSoldier  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1787
  • View blog
  • Posts: 5,697
  • Joined: 15-January 14

Re: Disable Previous and Next button on 1st and last page not working

Posted 17 April 2017 - 11:26 AM

What specifically does it do? Saying that it doesn't work doesn't provide a lot of information. If there are any Javascript errors, you'll see messages in the developer console if you open it. I would focus on the differences between the two applications and figure out why the differences are causing problems. You can also use console.log statements in your code to print information to the developer console, you can print the values of variables or things like that to help you figure out what's going on and where it's going wrong.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1