Paging on urls in data table
Paging on urls in data table
thsiao11
Posts: 2Questions: 0Answers: 0
Hi,
Is it possible to configure JQuery.datatables to read a table with a single column of urls and provide pagination function on these urls? For example, if I have a table like this:
<table><tr>
<td>www.apple.com</td>
<td>www.google.com</td>
<td>www.msn.com</td>
...
</tr></table>
Can I set up JQuery.datatables to provide the paging buttons based on the urls in my table above? I do not need to display the urls from the table above in the web page.
Thanks in advance
This discussion has been closed.
Replies
Yes. But you must add
tbody
andthead
elements, as noted in the requirements.Allan
Hi Allan,
Thanks for your response.
I am not sure I follow your suggestion. If I can explain my question in a different way. Let's say I have the following JQuery commands:
$(document).ready(function(){
$("#page1").click(function(){ $(location).attr('href', 'http://stackoverflow.com') });
$("#page2").click(function(){ $(location).attr('href', 'http://www.yahoo.com') });
...
});
Is there a way to use JQuery.datatables' pagination buttons to simulate the behavior of the commands above?
I'm not clear how you want to use the pagination buttons. They are used for paging to different pages in the table.
You can create custom buttons using the Buttons extension. These can be used to open the URLs.
https://datatables.net/extensions/buttons/custom
Kevin