Skip to content
Snippets Groups Projects
Commit 8340582b authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

add widget to search secreton db for strain

I use Jquery-ui autocompleter with jquery-ui smootheness style
parent 5978cc0e
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
<title>Secreton</title> <title>Secreton</title>
<link rel="stylesheet" href="style/main.css" type="text/css"> <link rel="stylesheet" href="style/main.css" type="text/css">
<link rel="stylesheet" href="style/tooltip.css" type="text/css"> <link rel="stylesheet" href="style/tooltip.css" type="text/css">
<link rel="stylesheet" href="style/smoothness/jquery-ui-1.8.17.custom.css" type="text/css">
<script src="/_utils/script/jquery.js"></script> <script src="/_utils/script/jquery.js"></script>
<script src="/_utils/script/jquery.couch.js"></script> <script src="/_utils/script/jquery.couch.js"></script>
<script src="/_utils/script/jquery-ui-1.8.11.custom.min.js"></script>
</head> </head>
<body> <body>
<div id="request"> <div id="request">
...@@ -24,15 +26,15 @@ ...@@ -24,15 +26,15 @@
<input type="text" name="taxidSearch" id="taxidInput"/> <input type="text" name="taxidSearch" id="taxidInput"/>
<button type="button" id="taxidButton">search by taxid</button> <button type="button" id="taxidButton">search by taxid</button>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label for="famillySearch">by T3SS family (ex:Hrp2)</label> <label for="famillySearch">by T3SS family</label>
<input type="text" name="familySearch" id="familyInput"/> <select name="familySearch" id="familyList">
<button type="button" id="familyButton">search by family</button> </select>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label for="famillySearch2">by T3SS family (ex:Hrp2)</label> <label for="strainSearch">by strain</label>
<select name="familySearch2" id="familyList"> <input type text="text" name="strainSearch" id="strainInput" size="100"/>
</select>
</fieldset> </fieldset>
</form> </form>
</div> </div>
...@@ -105,6 +107,29 @@ $(".tooltip" , "#results").live('mouseenter', function(){ ...@@ -105,6 +107,29 @@ $(".tooltip" , "#results").live('mouseenter', function(){
}); });
}); });
$("#strainInput").autocomplete({
source: function(req , response){
var term = '"'+$.trim(req.term).toLowerCase()+'"';
var suggestions =[];
$.getJSON("_view/strain", {key:term} , function(suggested_strain){
var cur_value ;
for(var i =0; i<suggested_strain.rows.length; i++){
if (cur_value != suggested_strain.rows[i].value){
suggestions.push(suggested_strain.rows[i].value);
cur_value = suggested_strain.rows[i].value;
}
}
response(suggestions);
});
},
select: function(evt , ui ){
strain= ui.item.value ;
params = { key: '"'+strain+'"' };
get_results( 'by_replicon_strain', params);
},
minLength:3
});
$("#paginate .nav_page").live( 'click', function(){ $("#paginate .nav_page").live( 'click', function(){
var url = $(this).attr('data-href'); var url = $(this).attr('data-href');
$("#results").load( url ); $("#results").load( url );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment