Changeset 2150 for trunk/grails-app/views/studyCompare/pages/_page_one.gsp
- Timestamp:
- Jan 24, 2012, 5:30:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/studyCompare/pages/_page_one.gsp
r2149 r2150 13 13 %> 14 14 <af:page> 15 <script type="text/javascript"> 16 var criteria = {}; 17 18 function handleCheckEvent(event) { 19 var check = $(event); 20 var value = check.attr('value'); 21 var parent = check.parent(); 22 var parentId = parent.attr('id'); 23 if (criteria[parentId] == undefined) criteria[parentId] = []; 24 var c = criteria[parentId]; 25 26 // add or remove data 27 if (check.is(':checked') && c.indexOf(value) < 0) { 28 c.push(value); 29 } else if (c.indexOf(value) >= 0) { 30 c.splice(c.indexOf(value),1); 31 } 32 33 console.log(criteria); 34 35 // ajax call 36 $.getJSON( 37 "<g:createLink controller="ajax" action="studyCount"/>", 38 criteria, 39 function(data) { 40 $('#matchedStudies').html(data.count+' studies matched your criteria'); 41 } 42 ); 43 44 // $.ajax({ 45 // url: baseUrl + "/ajax/studyCount", 46 // dataType: 'json', 47 // data: data, 48 // success: function(data) { 49 // $('#matchedStudies').html(data.count+' studies matched your criteria'); 50 // } 51 // }); 52 53 } 54 </script> 55 56 15 57 <div class="selector"> 16 58 <div name="species" id="uniqueSpecies" class="ajax"></div> … … 18 60 <div name="sampling event templates" id="uniqueSamplingEventTemplateNames" class="ajax"></div> 19 61 </div> 20 <div class="ajax" id="studyCount"></div>62 <div id="matchedStudies"></div> 21 63 22 64 </af:page>
Note: See TracChangeset
for help on using the changeset viewer.