我的页面有一个基因列表的数据值散点图。该列表可以是 30,000+。我有客户端上的所有数据,所以我的自动完成如下:
html:
<label>Search for a specific gene:</label> <input size=25 maxlength=100 id=gene_autocomplete class="autocomplete" />
CSS:
.ui-autocomplete {
max-width: 275px;
max-height: 300px;
overflow-y: auto;
overflow-x: hidden;
padding-right: 20px;
}
ul.ui-autocomplete li.ui-menu-item {
font-size: 11px;
margin-right: 15px;
}
Javascript:
$(document).ready(function () {
...
$("input#gene_autocomplete").autocomplete({source: data.ids, minLength:4});
... followed by parsing a data file
parseGct: function(dataText) {
var rows = dataText.split('\n');
this.vals = new Array();
this.colNames = rows[2].split('\t').splice(2);
for(var i = 3; i < rows.length; i++) {
var cols = rows[i].split('\t');
if(cols.length < 2) continue;
var data = cols.slice(2);
this.toFloat(data);
this.vals.push(data.slice());
}
},
我尝试了不同的延迟(0到700),但无济于事。通常浏览器超时。我能做些什么来加快速度?