Is there a way to control the url format of the pagination buttons?
Is there a way to control the url format of the pagination buttons?
RyanJRB
Posts: 2Questions: 1Answers: 1
Hello,
It looks like the href attribute of the pagination buttons is "#". Is there a way to control that or remove the href entirely, since it isn't a link? The reason is that the href="#" is causing the subpage to link to the root, like "/#" instead of "/subpage#
If I remove the href through the dev tools, pagination works properly.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @RyanJRB ,
I'm not following, I'm afraid, but you can create your own pagination controls - see here for a few existing ones. That will enable you to format those buttons as you please.
Cheers,
Colin
Colin,
I have since determined that this is a flaw in Blazor Preview 6, which misinterprets href="#" to act like href="/#". So your confusion about why that would happen is well-founded!
Thanks for the example of creating the control from scratch. I might still do that for style purposes. But for now, I found a simple fix to be adding:
$(".dataTables_wrapper a[href='#']").removeAttr("href");
to the drawCallback option.
Odd bug that one - thanks for posting back.
Allan
Removing the attribute works for the first click. Once I select page 2 the href=# is back.
I'm running: $(".dataTables_wrapper a[href='#']").removeAttr("href");
when I create the datatable. Is there somewhere else I should be running it?
Sorry. I see your drawcallback comment now. I didn't know what that was.
This works great now. Thanks.
function apply_General_DataTable(tableName) {
}