Discussion Locked

x of y pages in an xml data-bound table

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an HTML table (I set datapagesize=10)bound to an XML data island (with about 100 nodes). I also have navigation (First, Prev, etc) buttons for browsing the XML data 10 rows at a time. How do I determine which page I'm currently looking at, and how many pages there are (using JavaScript? I want to be able to say "Page X of Y pages", where X represents the current page, and Y is the number of pages.
Thanks.

1 reply

by pranav

Let's say that your node name is "rows"

This will give you total number of pages.
y = (count(//rows) div datapagesize)

I am not sure how are you getting the 10 rows, but if it is in a template, you can use
x = ( ./position() div datapagesize)

This discussion is closed to new replies.