tags:

views:

121

answers:

1

I have an IFrame with a Table enclosed within it. I want to display 15 rows of a table and than a Next button must be there to move forward.

How to apply pagination for IFrame?

+1  A: 

This is essentially answered in http://stackoverflow.com/questions/1473295/basic-jquery-question-how-to-change-iframe-src-by-clicking-a-link.

You would just need to build GET parameters for the frame source, and build links for each of the values in the main page.

For example:

<a href="foo.html?page=1" target="myiframe">Page 1</a>
<a href="foo.html?page=2" target="myiframe">Page 2</a>
<a href="foo.html?page=3" target="myiframe">Page 3</a>

<iframe name="myiframe"></iframe>

The catch is that your main page will need to know the status of the frame to generate the right links -- this will require some javascript parsing of the frame source URL and regenerating the links based on that.

Instead of using a frame, I would recommend loading the whole table inside the main page and using something like DataTables to generate the pagination for you.

anschauung