1
나는이 테이블는 선행 입력하고 첫 번째 셀을 선택
<table id="vehicleParamTable" class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
있습니다. 잘 됐네. 행의 첫 번째 열에서
, 나는선택기가 작동하지 않는 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')
좋은 보이지만, 정의되지 않은
를 돌려 나머지 (선행 입력 초기화 ..)와편집 2 동적으로 행을 추가했기 때문에 입력 헤드를 새로 고침해야합니다 ...