Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | var BootstrapTable = function () { |
| 2 | |||
| 3 | var TableTransform = function () { |
||
| 4 | var $table_transform = $('#table-transform'); |
||
| 5 | $('#transform').click(function () { |
||
| 6 | $table_transform.bootstrapTable(); |
||
| 7 | }); |
||
| 8 | $('#destroy').click(function () { |
||
| 9 | $table_transform.bootstrapTable('destroy'); |
||
| 10 | }); |
||
| 11 | } |
||
| 12 | |||
| 13 | var TableStyle = function () { |
||
| 14 | var $table_style = $('#table-style'); |
||
| 15 | // $table_style.bootstrapTable(); |
||
| 16 | |||
| 17 | $('#hover, #striped, #condensed').click(function () { |
||
| 18 | var classes = 'table'; |
||
| 19 | |||
| 20 | if ($('#hover').prop('checked')) { |
||
| 21 | classes += ' table-hover'; |
||
| 22 | } |
||
| 23 | if ($('#condensed').prop('checked')) { |
||
| 24 | classes += ' table-condensed'; |
||
| 25 | } |
||
| 26 | $('#table-style').bootstrapTable('destroy') |
||
| 27 | .bootstrapTable({ |
||
| 28 | classes: classes, |
||
| 29 | striped: $('#striped').prop('checked') |
||
| 30 | }); |
||
| 31 | }); |
||
| 32 | |||
| 33 | function rowStyle(row, index) { |
||
| 34 | var bs_classes = ['active', 'success', 'info', 'warning', 'danger']; |
||
| 35 | |||
| 36 | if (index % 2 === 0 && index / 2 < bs_classes.length) { |
||
| 37 | return { |
||
| 38 | classes: bs_classes[index / 2] |
||
| 39 | }; |
||
| 40 | } |
||
| 41 | return {}; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return { |
||
| 46 | |||
| 47 | //main function to initiate the module |
||
| 48 | init: function () { |
||
| 49 | |||
| 50 | TableTransform(); |
||
| 51 | TableStyle(); |
||
| 52 | } |
||
| 53 | |||
| 54 | }; |
||
| 55 | |||
| 56 | }(); |
||
| 57 | |||
| 58 | jQuery(document).ready(function() { |
||
| 59 | BootstrapTable.init(); |
||
| 60 | }); |