root/trunk/grails-app/views/assay/selectAssay.gsp @ 1445

Revision 1445, 1.4 KB (checked in by s.h.sikkema@…, 3 years ago)

Rudimentary assay export functionality

  • Property svn:keywords set to Rev Author Date
Line 
1<%--
2  Created by IntelliJ IDEA.
3  User: siemensikkema
4  Date: Nov 30, 2010
5  Time: 4:07:28 PM
6--%>
7
8<%@ page import="dbnp.studycapturing.Study" contentType="text/html;charset=UTF-8" %>
9<html>
10  <head>
11    <meta name="layout" content="main" />
12    <title>Select an assay</title>
13    <script type="text/javascript">
14      function updateAssay(jsonData, selectID) {
15        var a = eval(jsonData);
16        var sel = $('#'+selectID).empty();
17       
18        $(a).each(function(i, el){
19          sel.append($("<option></option>").attr("value",el.id).text(el.name))
20        })
21      }
22
23      $(document).ready(function(){
24        // trigger change event to load assay based on currently selected study.
25        // After pressing 'Back', the browser may use last selected study.
26        $('#study').change()
27
28      })
29    </script>
30  </head>
31  <body>
32  <div style="color:red;">
33    ${flash.errorMessage}
34  </div>
35  <g:form name="assaySelect" action="exportAssayAsExcel">
36    <g:select optionKey="id" optionValue="title" name="studyId" from="${userStudies}" id="study"
37      onChange="${remoteFunction(controller:'study',action:'ajaxGetAssays',params:'\'id=\'+escape(this.value)',onComplete: 'updateAssay(XMLHttpRequest.responseText, \'assay\')')}"/>
38    <g:select optionKey="id" name="assayId" id="assay" from=""/>
39    %{--<g:select optionKey="id" name="assayId" id="assay" from="${assays}"/>--}%
40    <g:submitButton name="submit" value="Submit"/>
41  </g:form>
42  </body>
43</html>
Note: See TracBrowser for help on using the browser.