5 /locus/associate_locus.mas - a component for printing an 'associate_locus' javasript form
9 this component has dependencies on CXGN.Phenome.Locus and CXGN.AJAX.Ontology
10 you will have to import these javascript classes in your code that uses this component.
12 <& /util/import_javascript.mas, classes => [CXGN.Phenome.Locus", "CXGN.AJAX.Ontology"] &>
30 Naama Menda <nm249@cornell.edu>
40 $locus_autocomplete_uri => '/ajax/locus/autocomplete'
44 <script language="javascript">
47 jQuery(document).ready(function() {
48 var common_name = jQuery('#organism_select option:selected').attr("value");
49 jQuery("#loci").autocomplete({
50 source: '<% $locus_autocomplete_uri %>' + "?common_name=" + common_name + "&mode=no_alleles",
53 select: function(event, ui) {
54 Ontology.populateEvidence('locus_relationship_select', '/ajax/cvterm/locus_relationships'); }
57 jQuery("#organism_select").change(function(){
58 common_name = jQuery('#organism_select option:selected').attr("value");
59 jQuery("#loci").autocomplete('option', 'source', '<% $locus_autocomplete_uri %>' + "?common_name=" + common_name + "&mode=no_alleles");
67 <div id='associateLocusForm' style="display: none">
68 <div id='locus_search'>
69 <form name="loci_form" >
73 value = "--type a locus name--" >
74 <select id = "organism_select" onchange="jQuery('#loci').val('--type a locus name--');$('associate_locus_button').disabled=true">
77 <select id="locus_relationship_select" style="width: 50%"
78 onchange= "Ontology.populateEvidence('locus_evidence_code_select', '/ajax/cvterm/evidence', '--select an evidence code--');" >
80 <select id="locus_evidence_code_select" style="width: 50%"
81 onchange="Ontology.populateEvidence('locus_reference_select', '/locus/<% $locus_id %>/references', '--Optional: select supporting reference --');$('associate_locus_button').disabled=false">
83 <select id="locus_reference_select" style="width: 100%">
86 id="associate_locus_button"
87 value="Associate locus"
89 onclick="Locus.associateLocus('<% $locus_id %>');this.disabled=true;" />