index.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  6. <title>bootstrap-table demo</title>
  7. <meta name="author" content="zhixin" />
  8. <link rel="stylesheet" href="/css/bootstrap.css" />
  9. <link rel="stylesheet" href="/css/fork.css" />
  10. </head>
  11. <body>
  12. <div class="container">
  13. <h3>Table Properties:</h3>
  14. <table id="table"></table>
  15. <h3>Column Properties:</h3>
  16. <table id="column"></table>
  17. <h3>Events:</h3>
  18. <table id="event"></table>
  19. <h3>Methods:</h3>
  20. <table id="method"></table>
  21. </div>
  22. <a href="https://github.com/wenzhixin/bootstrap-table" class="fork_me"></a>
  23. <script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script>
  24. <script type="text/javascript" src="bootstrap-table.js"></script>
  25. <script type="text/javascript">
  26. $(function() {
  27. $('#table').bootstrapTable({
  28. columns: [
  29. {field: 'name', title: 'Name', align: 'center', width: 60},
  30. {field: 'type', title: 'Type', align: 'center', width: 60},
  31. {field: 'description', title: 'Description', width: 400},
  32. {field: 'default', title: 'Default', align: 'right', width: 180}
  33. ],
  34. data: [
  35. {name: 'class', type: 'String', description: 'The table class', default: 'table table-bordered table-hover'},
  36. {name: 'columns', type: 'Array', description: 'The table columns config object, see column properties for more details.', default: '[]'},
  37. {name: 'data', type: 'Array', description: 'The data to be loaded.', default: '[]'}
  38. ]
  39. });
  40. $('#column').bootstrapTable({
  41. columns: [
  42. {field: 'name', title: 'Name', align: 'center', width: 60},
  43. {field: 'type', title: 'Type', align: 'center', width: 60},
  44. {field: 'description', title: 'Description', width: 400},
  45. {field: 'default', title: 'Default', align: 'right', width: 180}
  46. ],
  47. data: [
  48. {name: 'field', type: 'String', description: 'The column field name.', default: 'undefined'},
  49. {name: 'title', type: 'String', description: 'The column title text.', default: 'undefined'},
  50. {name: 'align', type: 'String', description: 'Indicate how to align the column data. "left", "right", "center" can be used.', default: 'undefined'},
  51. {name: 'width', type: 'Number', description: 'The width of column. If not defined, the width will auto expand to fit its contents.', default: 'undefined'},
  52. {name: 'formatter', type: 'Function', description: 'The cell formatter function, take two parameters: <br />value: the field value. <br />row: the row record data.', default: 'undefined'}
  53. ]
  54. });
  55. $('#event').bootstrapTable({
  56. columns: [
  57. {field: 'name', title: 'Name', align: 'center', width: 100},
  58. {field: 'parameter', title: 'Parameter', align: 'center', width: 100},
  59. {field: 'description', title: 'Description', width: 400}
  60. ],
  61. data: [
  62. {name: 'onClickRow', parameter: 'row', description: 'Fires when user click a row, the parameters contains: <br />row: the record corresponding to the clicked row'}
  63. ]
  64. });
  65. $('#method').bootstrapTable({
  66. columns: [
  67. {field: 'name', title: 'Name', align: 'center', width: 100},
  68. {field: 'parameter', title: 'Parameter', align: 'center', width: 100},
  69. {field: 'description', title: 'Description', width: 400}
  70. ],
  71. data: [
  72. {name: 'load', parameter: 'data', description: 'Load the data to table.'},
  73. {name: 'append', parameter: 'data', description: 'Append the data to table.'}
  74. ]
  75. });
  76. });
  77. </script>
  78. <script type="text/javascript" src="/js/analytics.js"></script>
  79. </body>
  80. </html>