Changeset 2145

Show
Ignore:
Timestamp:
23-01-12 12:40:17 (2 years ago)
Author:
work@…
Message:

- add generic ajax controller to provide a basic ajax api
- added unique species to base study compare page
- deleted default images

Location:
trunk
Files:
1 added
1 removed
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/studyCompare/index.gsp

    r2144 r2145  
    1515<head> 
    1616        <meta name="layout" content="main"/> 
     17        <g:if env="development"> 
    1718        <link rel="stylesheet" href="${resource(dir: 'css', file: 'ajaxflow.css')}"/> 
     19        </g:if><g:else> 
     20        <link rel="stylesheet" href="${resource(dir: 'css', file: 'ajaxflow.min.css')}"/> 
     21        </g:else> 
    1822</head> 
    1923<body> 
  • trunk/grails-app/views/studyCompare/pages/_page_one.gsp

    r2141 r2145  
    1010 * $Author:  duh $ 
    1111 * $Date:  2010-12-22 17:45:42 +0100 (Wed, 22 Dec 2010) $ 
     12 * 
     13 
     14 <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
     15 <title>Select test</title> 
     16 <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> 
     17 <script type="text/javascript" charset="utf-8"> 
     18 $(function(){ 
     19 $("select#ctlJob").change(function(){ 
     20 $.getJSON("select.php",{id: $(this).val()}, function(j){ 
     21 var options = ''; 
     22 for (var i = 0; i < j.length; i++) { 
     23 options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     24 } 
     25 $("#ctlPerson").html(options); 
     26 $('#ctlPerson option:first').attr('selected', 'selected'); 
     27 }) 
     28 })                      
     29 }) 
     30 </script> 
     31 </head> 
     32 <body> 
     33 <select id="ctlJob"> 
     34 <option value="1">Manager</option> 
     35 <option value="2">Lead Dev</option> 
     36 <option value="3">Developer</option> 
     37 </select> 
     38 <select id="ctlPerson"> 
     39 <option value="1">Mark</option> 
     40 <option value="2">Andy</option> 
     41 <option value="3">Richard</option> 
     42 </select> 
     43 </body>  
     44  
    1245 */ 
    1346%> 
    1447<af:page> 
    15 <h1>Page one of the '<i>studyCompare</i>' ajaxflow</h1> 
    16 <p> 
    17         <b> 
    18                 This ajaxflow supports by default a spinner / please wait dialogue when clicking buttons / tabs. This 
    19                 can be disabled by removing the <i>spinner="ajaxFlowWait"</i> argument from the <i>af:flow</i> 
    20                 definition in <i>common/_ajaxflow.gsp</i>. If you're disabling this feature you might also want to remove the 
    21                 then obsolete tag &lt;g:render template="common/please_wait"/&gt; from <i>common/_ajaxflow.gsp</i> 
    22                 as well. 
    23         </b> 
    24 </p> 
    25 <p> 
    26         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ultricies sapien vestibulum mi mattis sed mollis lorem hendrerit. Sed pretium dignissim placerat. Maecenas ut lorem dui, nec lacinia massa. Nunc pharetra justo sed purus fermentum lobortis. Quisque ac ante at sapien faucibus feugiat. Aliquam lacus tortor, gravida eget mollis quis, lacinia eu enim. Phasellus vel neque neque, rhoncus volutpat erat. Aliquam sodales porttitor urna, sed volutpat ipsum lacinia vitae. Nam pretium, eros fringilla vehicula congue, erat quam congue est, at feugiat ante ante nec magna. Pellentesque placerat facilisis massa in venenatis. Proin turpis lorem, viverra at posuere id, porta a justo. Quisque consectetur enim at justo dapibus pulvinar. 
    27 </p> 
    28 <p> 
    29         Cras tristique iaculis massa ac semper. Morbi malesuada pellentesque magna, nec pellentesque risus pretium at. Nullam eros velit, iaculis eget porta nec, euismod vitae diam. Maecenas tincidunt fermentum erat, sit amet aliquet ligula luctus sed. Vestibulum sed viverra metus. In hac habitasse platea dictumst. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam dictum, lacus ac placerat condimentum, leo est consequat velit, et euismod augue leo ut leo. Sed blandit mi sed tortor elementum in placerat tortor pellentesque. Donec diam lorem, elementum vitae eleifend eget, suscipit id magna. Pellentesque nunc nulla, aliquam vel lobortis quis, ullamcorper quis eros. Maecenas cursus, orci a accumsan pulvinar, velit est adipiscing arcu, ac fermentum ligula felis sit amet velit. Pellentesque ac mauris a nisl fermentum vestibulum a a est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent a magna elit. 
    30 </p> 
     48<script type="text/javascript"> 
     49// get unique species 
     50$.getJSON("${createLink(controller:'ajax', action:'uniqueSpecies')}",{},function(j) { 
     51        var options = ''; 
     52        for (var i=0;i<j.length;i++) { 
     53                options += '<option value="'+j[i].id+'">'+j[i].name+'</option>'; 
     54        } 
     55        $("#species").html(options); 
     56        $("#species option:first").attr('selected', 'selected'); 
     57}); 
     58</script> 
     59 
     60species: <select id="species"/><br/> 
     61 
     62 
     63 
    3164</af:page>