rejetto forum

Try another form of paging with ?offset=10&limit=10

RVO · 3 · 1589

0 Members and 1 Guest are viewing this topic.

Offline RVO

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Good Morning. I've been doing some tests and I think it's possible to do pagination with? Offset = 10 & limit = 10 for example. But I can not make a script to do it automatically. The most I got was this:

<script language="JavaScript" type="text/javascript">
<!--
var vCont = 0;
function conta(){
vCont = vCont + 10;
document.getElementById('contador').value = vCont;
}
//-->
<!--
var vCont = 0;
function deconta(){
vCont = vCont - 10;
document.getElementById('contador').value = vCont;
}
//-->
</script>

</head>
<body>
<div class="pager" align="center">

<form >

   <input type="button" value="prev" onclick="deconta();" />
      <input type="text" value="" id="contador" name="isso"  size="5" />
   <input type="button" value="next" onclick="conta();" />
 
           <a class="command" href="#" onclick="this.href='?offset='+document.getElementById('contador').value+'&limit=10'" > Ir</a>
        </form >

</div>


But it is very handmade. Can you help me do what it should be? Another problem I have is that using this system does not work when I want to organize by date added files. They are always organized by name. Thank you in advance for the help.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
The management of the pagination with offset and limit is no longer used, because it requires to constantly launch requests to the server as form, the solution adopted by rejetto is to send the complete list of the files from the server to the client on which the elements are hidden when they do not belong to the current page.

If you want to manage the number of elements per page, you have to do it in JavaScript by adapting the elements used in this message
http://www.rejetto.com/forum/hfs-~-http-file-server/results-per-page/msg1062070/#msg1062070