Pagination in Dynamic Data ListPagination in Dynamic Data Listhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=702046802024-03-29T07:20:31Z2024-03-29T07:20:31ZRE: Pagination in Dynamic Data ListKarl Pantihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1171930392019-09-18T03:10:12Z2019-09-18T03:10:12ZHi guys, Im a new member here. <br />seeking for your help.. i've been spending the whole week trying to find a way to my program..This is also about DataTable. <br />I also used some of your codes above... but it didnt worked for my table..<br /><br /><em><strong> this is my code.. the data is being looped by foreach</strong></em><br /> <div class="main"><br /> <table id="data-table"><br /> <thead><br /> <tr><br /> <th>Name</th><br /> <th>Age</th><br /> <th>Full Address</th><br /> <th>Action</th><br /> <th>Grade</th><br /> <th>Section</th><br /> </tr><br /> </thead><br /> @foreach (var info in Model)<br /> {<br /> <tbody><br /> <tr><br /> <td>@info.StudentName</td><br /> <td>@info.StudentAge</td><br /> <td>@info.StudentAddress </td><br /> <td><br /> @Html.ActionLink("Edit", "Edit", new { id = info.StudentId }) |<br /> @Html.ActionLink("Delete", "Delete", new { id = info.StudentId })<br /> </td><br /> <td>@info.StudentGrade</td><br /> <td>@info.StudentSection </td><br /> </tr><br /> </tbody><br /> } </table><br /> </div><br /><br /><em><strong>This is the script.. </strong></em><br /><br /><link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"><br /> <script src="https://code.jquery.com/jquery-3.3.1.js"></script><br /> <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script><br /> <script><br /> $(document).ready(function () {<br /> $('table#data-table').DataTable({<br /> "paging": true,<br /> "searching": false,<br /> "info": false<br /> });<br /> });<br /> </script>Karl Panti2019-09-18T03:10:12ZRE: Pagination in Dynamic Data ListVikash Kumarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=704423992016-02-25T11:44:35Z2016-02-25T11:44:35Z<div class="quote-title">Praful Shukla:</div><blockquote>Thank you so much..!!<br />It's working now..!!<img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" ><img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" ></blockquote><br /><br /><br />happyVikash Kumar2016-02-25T11:44:35ZRE: Pagination in Dynamic Data ListPraful Shuklahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=704357642016-02-25T10:19:45Z2016-02-25T10:19:45ZThank you so much..!!<br />It's working now..!!<img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" ><img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" >Praful Shukla2016-02-25T10:19:45ZRE: Pagination in Dynamic Data ListVikash Kumarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=703532282016-02-24T09:23:15Z2016-02-24T09:23:15ZPlease try this,<br /><br /><link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.11/css/jquery.dataTables.css"><br /><script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.11/js/jquery.dataTables.js"></script><br /><br /><script><br />$(document).ready(function(){<br />//For Pagination with DataTable<br />$('table#data-table').dataTable( {<br />"paging": true,<br />"searching":false,<br />"info": false<br />}); <br />}); <br /></script><br /><br />#if (!$records.isEmpty())<br /><table id="data-table" class="table table-bordered table-hover table-striped"> <br /><thead class="table-columns"><br /><th class="table-first-header" >Customer ID</th> <br /><th class="" >Name</th> <br /><th class="" >Address</th> <br /></thead><br />#foreach ($cur_record in $records)<br /><tr><br /><td>$cur_record.getFieldValue("Custome_ID", $locale)</td><br /><td>$cur_record.getFieldValue("Name", $locale)</td><br /><td>$cur_record.getFieldValue("Address", $locale)</td><br /></tr><br />#end<br /></table>Vikash Kumar2016-02-24T09:23:15ZRE: Pagination in Dynamic Data ListPraful Shuklahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=703472182016-02-24T06:44:38Z2016-02-24T06:44:38Z<div class="quote-title">Neha Goyal:</div><blockquote>Shukla,<br /><br />Did you download js and css file.What error you are getting?<br />Alternatively go with Manish approach.<br /><br />Regards:<br />Neha</blockquote><br /><br />Hello,<br />Where should I store the downloaded css file..??Please guide me I'm new to Liferay.<br />I have just written the above script that you have provided in my Display Template but<br />the displayed result is not paginated.Praful Shukla2016-02-24T06:44:38ZRE: Pagination in Dynamic Data ListVikash Kumarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702256982016-02-22T12:29:59Z2016-02-22T12:29:59ZShukla,<br /><br />Did you download js and css file.What error you are getting?<br />Alternatively go with Manish approach.<br /><br />Regards:<br />NehaVikash Kumar2016-02-22T12:29:59ZRE: Pagination in Dynamic Data ListManish Yadavhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702247872016-02-22T11:58:13Z2016-02-22T11:58:13ZHave you check javascript imports .....<br /><br /><br /><br />Try with <br />https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.jsManish Yadav2016-02-22T11:58:13ZRE: Pagination in Dynamic Data ListPraful Shuklahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702230352016-02-22T11:44:58Z2016-02-22T11:44:58Z<div class="quote-title">Neha Goyal:</div><blockquote><div class="quote-title">Praful Shukla:</div><blockquote>Thanks Neha for the Quick Reply,following is the Velocity Script for Display Template of my DDL:<br /><br />#if (!$records.isEmpty())<br /><table class="table table-bordered table-hover table-striped"> <br /><thead class="table-columns"><br /><th class="table-first-header" >Customer ID</th> <br /><th class="" >Name</th> <br /><th class="" >Address</th> <br /></thead><br />#foreach ($cur_record in $records)<br /><tr><br /><td>$cur_record.getFieldValue("Custome_ID", $locale)</td><br /><td>$cur_record.getFieldValue("Name", $locale)</td><br /><td>$cur_record.getFieldValue("Address", $locale)</td><br /></tr><br />#end<br /></table><br />#end</blockquote><br /><br /><link rel="stylesheet" type="text/css" href="Editor-1.5.5/css/editor.dataTables.css"><br /><script type="text/javascript" src="Editor-1.5.5/js/dataTables.editor.js"></script><br /><script><br /> $(document).ready(function(){<br /> //For Pagination with DataTable<br /> $('table#data-table').dataTable( {<br /> "paging": true,<br /> "searching":false,<br /> "info": false<br /> }); <br /> }); <br /></script><br /><br />#if (!$records.isEmpty())<br /><table id="data-table" class="table table-bordered table-hover table-striped"> <br /><thead class="table-columns"><br /><th class="table-first-header" >Customer ID</th> <br /><th class="" >Name</th> <br /><th class="" >Address</th> <br /></thead><br />#foreach ($cur_record in $records)<br /><tr><br /><td>$cur_record.getFieldValue("Custome_ID", $locale)</td><br /><td>$cur_record.getFieldValue("Name", $locale)</td><br /><td>$cur_record.getFieldValue("Address", $locale)</td><br /></tr><br />#end<br /></table><br /><br /><br />Let me know if this template fix your problem.<br /><br /><br />Regards:<br />Naha</blockquote><br /><br /><br />Hi,<br />Sorry to say Neha,but it didn't worked..Praful Shukla2016-02-22T11:44:58ZRE: Pagination in Dynamic Data ListVikash Kumarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702192542016-02-22T11:04:29Z2016-02-22T11:04:29Z<div class="quote-title">Praful Shukla:</div><blockquote>Thanks Neha for the Quick Reply,following is the Velocity Script for Display Template of my DDL:<br /><br />#if (!$records.isEmpty())<br /><table class="table table-bordered table-hover table-striped"> <br /><thead class="table-columns"><br /><th class="table-first-header" >Customer ID</th> <br /><th class="" >Name</th> <br /><th class="" >Address</th> <br /></thead><br />#foreach ($cur_record in $records)<br /><tr><br /><td>$cur_record.getFieldValue("Custome_ID", $locale)</td><br /><td>$cur_record.getFieldValue("Name", $locale)</td><br /><td>$cur_record.getFieldValue("Address", $locale)</td><br /></tr><br />#end<br /></table><br />#end</blockquote><br /><br /><link rel="stylesheet" type="text/css" href="Editor-1.5.5/css/editor.dataTables.css"><br /><script type="text/javascript" src="Editor-1.5.5/js/dataTables.editor.js"></script><br /><script><br /> $(document).ready(function(){<br /> //For Pagination with DataTable<br /> $('table#data-table').dataTable( {<br /> "paging": true,<br /> "searching":false,<br /> "info": false<br /> }); <br /> }); <br /></script><br /><br />#if (!$records.isEmpty())<br /><table id="data-table" class="table table-bordered table-hover table-striped"> <br /><thead class="table-columns"><br /><th class="table-first-header" >Customer ID</th> <br /><th class="" >Name</th> <br /><th class="" >Address</th> <br /></thead><br />#foreach ($cur_record in $records)<br /><tr><br /><td>$cur_record.getFieldValue("Custome_ID", $locale)</td><br /><td>$cur_record.getFieldValue("Name", $locale)</td><br /><td>$cur_record.getFieldValue("Address", $locale)</td><br /></tr><br />#end<br /></table><br /><br /><br />Let me know if this template fix your problem.<br /><br /><br />Regards:<br />NahaVikash Kumar2016-02-22T11:04:29ZRE: Pagination in Dynamic Data ListPraful Shuklahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702172032016-02-22T10:00:30Z2016-02-22T10:00:30ZThanks Neha for the Quick Reply,following is the Velocity Script for Display Template of my DDL:<br /><br />#if (!$records.isEmpty())<br /><table class="table table-bordered table-hover table-striped"> <br /><thead class="table-columns"><br /><th class="table-first-header" >Customer ID</th> <br /><th class="" >Name</th> <br /><th class="" >Address</th> <br /></thead><br />#foreach ($cur_record in $records)<br /><tr><br /><td>$cur_record.getFieldValue("Custome_ID", $locale)</td><br /><td>$cur_record.getFieldValue("Name", $locale)</td><br /><td>$cur_record.getFieldValue("Address", $locale)</td><br /></tr><br />#end<br /></table><br />#endPraful Shukla2016-02-22T10:00:30ZRE: Pagination in Dynamic Data ListAbdur Rasheedhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702177512016-02-22T09:48:56Z2016-02-22T09:48:56ZHi Shukla,<br /> We can implement from search container pagination, we have no. of docs. for pagination.<br /><br />https://www.liferay.com/community/wiki/-/wiki/Main/Pagination+in+Liferay<br /><br />Thanks<br />RasheedAbdur Rasheed2016-02-22T09:48:56ZRE: Pagination in Dynamic Data ListVikash Kumarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=702099932016-02-22T07:45:47Z2016-02-22T07:45:47ZHave you created any template for this. You can use dataTable jquery plugin to achieve this.<br />If you share me your template, i can modify and will integrate that template with dataTable which will support pagination.<br /><br /><br />Regards:<br />NehaVikash Kumar2016-02-22T07:45:47ZPagination in Dynamic Data List