DataTables pagination links to incorrect URL
DataTables pagination links to incorrect URL
Hey guys,
I have a little problem with datatables on my blazor site.
I´ve pagination enabled, but when I want to change the site my browser opens the url cause datatables does not recognize the correct url.
The correct url was: https://localhost:44314/exec/state/3 but datatables thinks that its https://localhost:44314/#. Cause its not the root site, my browser loads the root site instead of changing the page.
Is there anything special, which I must look for?
My datatable config looks like this:
$(table).DataTable({
"paging": true,
"lengthChange": true,
"searching": false,
"ordering": true,
"info": false,
"autoWidth": false,
"scrollX": true,
"scrollY": true,
});
Thanks for anyone who can help!
Best regards,
Robert
Answers
Datatables pagination doesn't, by default, use URLs to move between pages. Maybe you have something custom setup for this. How do you "change the site"?
Kevin
Hi Kevin,
But datatables provide a paging at the bottom with <Previous> [1],2,3,4,5,... <Next>
Is there no standard way to change the page to the next site or to a specific?
PS: with "change the site" I mean to go to next result page from 1 to 2 etc.
This example shows the default Datatables paging. There are no URLs generated to from one page to the next. If a URL is being used then that is custom code. Paging plugins can be created. Here are some examples:
https://datatables.net/plug-ins/pagination/
Can you post a link to your page or a test case replicating the problem so we can take a look?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hey,
here is a picture of my problem, as mentioned above, I´ve the following URL opened: https://localhost:44314/exec/state/3 but if I click on page "2" or anything else to switch to another page he setz https://localhost:44314/# as url and my browser thinks he must open the site.
The URL must be https://localhost:44314/exec/state/3# to not open a new site...
Seeing a screenshot doesn't provide the information needed to help. In order to help we will need to see your code. Please post a link to you page or a test case.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin