Walther Posted Friday at 08:55 PM Share Posted Friday at 08:55 PM I'm trying to create a page to display a report with several thousand records using tablelist.tpl. The problem is that I can't get pagination to work: it always shows all the (2000+) records on a single screen, whereas I would like them to be displayed in groups (10, 25, or 50), as is done, for example, in clientareadomains.tpl. However, I haven't been able to find any documentation on tablelist.tpl anywhere, so I have no idea how to implement this... Below is my TPL code: {include file="$template/includes/tablelist.tpl" tableName="DomainsResellerLogs" noSortColumns="4,5,6" filterColumn="0"} <script type="text/javascript"> jQuery(document).ready(function() { var table = getTableInstance('DomainsResellerLogs'); table.on('draw.dt', function() { //further customizations as needed }); }); </script> <div class="table-container"> <table id="tableDomainsResellerLogs" class="table table-list"> <thead> <tr> <th>Date</th> <th>Order ID</th> <th>Rel ID</th> <th>Request</th> <th>Response</th> <th>Result</th> <th>IP</th> </tr> </thead> <tbody> {foreach from=$logs item=log} <tr> <td><pre>{$log->date|wordwrap:10:"<br>":true}</pre></td> <td>{$log->order_id}</td> <td>{$log->relid}</td> <td><pre>{$log->request|wordwrap:40:"<br>":true}</pre></td> <td><pre>{$log->response|wordwrap:40:"<br>":true}</pre></td> <td>{$log->result}</td> <td><pre>{$log->ip}</pre></td> </tr> {/foreach} </tbody> </table> </div> 0 Quote Link to comment Share on other sites More sharing options...
DristiTechnologies Posted 23 hours ago Share Posted 23 hours ago Try this <script> jQuery(document).ready(function () { const table = getTableInstance('DomainsResellerLogs'); table.DataTable({ pageLength: 25, // Default rows per page lengthMenu: [10, 25, 50, 100], order: [[0, 'desc']], // Optional default sorting }); }); </script> 0 Quote Link to comment Share on other sites More sharing options...
Walther Posted 9 hours ago Author Share Posted 9 hours ago 13 hours ago, DristiTechnologies said: Try this <script> jQuery(document).ready(function () { const table = getTableInstance('DomainsResellerLogs'); table.DataTable({ pageLength: 25, // Default rows per page lengthMenu: [10, 25, 50, 100], order: [[0, 'desc']], // Optional default sorting }); }); </script> Nope, it doesn't work... 😟 I guess something must be set in PHP code too, but I can't find any example or documentation about... 0 Quote Link to comment Share on other sites More sharing options...
Mytihost Posted 6 hours ago Share Posted 6 hours ago This is an AI generated response to your query <script type="text/javascript"> jQuery(document).ready(function() { var table = jQuery('#tableDomainsResellerLogs').DataTable({ pageLength: 25, // default rows per page lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ], ordering: true, searching: true, paging: true }); table.on('draw', function() { // Optional: trigger any redraw logic }); }); </script> 0 Quote Link to comment Share on other sites More sharing options...
bear Posted 3 hours ago Share Posted 3 hours ago 3 hours ago, Mytihost said: This is an AI generated response to your query You should write your own. AI is not to be trusted. 0 Quote Link to comment Share on other sites More sharing options...
Mytihost Posted 2 hours ago Share Posted 2 hours ago 33 minutes ago, bear said: You should write your own. AI is not to be trusted. Maybe you can solve there issue for them instead of commenting on what people should or shouldn't be doing. The same AI has saved me hundreds of pounds in whmcs development costs and it's also helped out other people on these forums in the past with no complaints. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.