1
私は、この表は、先行入力された文字と最初のセル選択
<table id="vehicleParamTable" class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
を持っています。それはうまく動作します。行の最初の列に
、Iは、第1行の(目ヘッダ)それを回避したいと思い、jqueryの-typehead
セレクタが動作していない追加
$('#vehicleParamTable tr td:first-child').typeahead({
minLength: 2,
display: "name",
mustSelectItem: true,
emptyTemplate: function(query) {
//must reset current element here
return 'No result for "' + query + '"';
},
source: {
vehicleParam: {
ajax: {
url: "/rest/vehicleparam",
path: "content"
}
}
},
callback: {
onEnter: function(node, a, item, event) {
//must assign item.id to current current element id
},
onResult: function(node, query, result, resultCount, resultCountPerGroup) {
if (resultCount < 1) {
//must reset current element here
}
}
}
});
編集
$('#vehicleParamTable tr td:first-child')
は良いように見えるが、未定義
を返し、残り(先行入力のinit ...)と編集2動的に行を追加するため、タイプヘッドをリフレッシュする必要があります...