|
3 | 3 | <title>Samples</title> |
4 | 4 | <g:set var="defaultGalaxy" value="${defaultGalaxy}" scope="request"/> |
5 | 5 | <meta name="layout" content="analysis"/> |
6 | | - <!-- <asset:javascript src="cookie.js"/> --> |
| 6 | + <asset:javascript src="cookie.js"/> |
7 | 7 | <link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"></style> |
8 | 8 | <script type="text/javascript" src="http://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> |
9 | 9 | </head> |
|
23 | 23 | }); |
24 | 24 |
|
25 | 25 | $(document).ready(function(){ |
26 | | - // hedgiejo: reset all the checkboxes and checkedCount (View Checked Samples number) |
| 26 | + // BugFix || git:hedgiejo || Reset all the checkboxes and checkedCount when reloading |
| 27 | + $('#selectAll').prop('checked', false); |
| 28 | + $('.checkbox').prop('checked', false); |
27 | 29 | $.ajax({url:"/pegr/sample/clearCheckedSampleAjax", success: function(checkedCount) { |
28 | | - $('.checkbox').prop('checked', false); |
29 | | - $('#selectAll').prop('checked', false); |
30 | | - $("#checked-count").text(checkedCount); |
| 30 | + checkedCount = 0; |
| 31 | + $("#checked-count").text(checkedCount); |
31 | 32 | }}); |
32 | 33 |
|
33 | 34 | $('#table_id').DataTable()({ |
|
38 | 39 | }); |
39 | 40 | }); |
40 | 41 |
|
41 | | - //BugFix || git:hedgiejo || Add checkbox feature that can select and deselect all checkboxes. |
| 42 | + // BugFix || git:hedgiejo || Add checkbox feature that can select and deselect all checkboxes. |
42 | 43 | $('#selectAll').click(function(checkedCount) { |
43 | 44 | if (this.checked) { |
44 | 45 | var sampleIds = []; |
45 | 46 | $('.checkbox').prop('checked', true); |
46 | 47 | $('.checkbox').each(function(){ |
47 | 48 | sampleIds.push(this.value); |
48 | 49 | }) |
| 50 | + console.log(JSON.stringify(sampleIds)) |
49 | 51 | $.ajax({ |
50 | | - url:"${createLink(controller: 'sample', action: 'addAllCheckedSampleAjax')}", |
51 | | - type:"GET", |
52 | | - data: {"sampleIdsList": JSON.stringify(sampleIds)}, |
| 52 | + url:"/pegr/sample/addAllCheckedSampleAjax", |
| 53 | + data: {"sampleIdsList":JSON.stringify(sampleIds)}, |
53 | 54 | success : function(checkedCount){ |
54 | 55 | $("#checked-count").text(checkedCount); |
55 | 56 | } |
56 | 57 | }); |
57 | 58 | } |
58 | 59 | else { |
59 | | - $.ajax({url:"/pegr/sample/clearCheckedSampleAjax", success: function(checkedCount) { |
60 | 60 | $('.checkbox').prop('checked', false); |
| 61 | + $.ajax({url:"/pegr/sample/clearCheckedSampleAjax", success: function(checkedCount) { |
| 62 | + checkedCount = 0; |
61 | 63 | $("#checked-count").text(checkedCount); |
62 | 64 | }}); |
63 | 65 | } |
|
0 commit comments