layout.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Pagination Layout - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Pagination Layout</h2>
  14. <p>The pagination layout supports various types of pages which you can choose.</p>
  15. <div style="margin:20px 0;"></div>
  16. <div class="easyui-panel">
  17. <div id="pp" class="easyui-pagination" data-options="
  18. total:114,
  19. layout:['first','prev','next','last','info']
  20. "></div>
  21. </div>
  22. <div style="margin-top:10px">
  23. <select onchange="setLayout(this.value)">
  24. <option value="1">Previous Next</option>
  25. <option value="2">Manual Page Input</option>
  26. <option value="3">Numeric Links</option>
  27. <option value="4">Previous Links Next</option>
  28. <option value="5">Go To Page</option>
  29. </select>
  30. </div>
  31. <script>
  32. function setLayout(type){
  33. var p = $('#pp');
  34. switch(parseInt(type)){
  35. case 1:
  36. p.pagination({layout:['first','prev','next','last','info']});
  37. break;
  38. case 2:
  39. p.pagination({
  40. layout:['list','sep','first','prev','sep','manual','sep','next','last','sep','refresh'],
  41. beforePageText:'Page',
  42. afterPageText:'of {pages}'
  43. });
  44. break;
  45. case 3:
  46. p.pagination({layout:['links']});
  47. break;
  48. case 4:
  49. p.pagination({layout:['first','prev','links','next','last']});
  50. break;
  51. case 5:
  52. p.pagination({
  53. layout:['first','prev','next','last','sep','links','sep','manual','info'],
  54. beforePageText:'Go Page',
  55. afterPageText:''
  56. });
  57. break;
  58. }
  59. }
  60. </script>
  61. </body>
  62. </html>