I have a container with the class 'table-responsive' that has overflow-x set to 'auto'.
Within this container, there is an input field with typeahead. When I receive results to populate the typeahead, they appear within the container. How can I move outside of it?
Here is my HTML code:
<div class="table-responsive">
<fieldset>
<legend>Rows</legend>
<table id="detailDocument" class="table table-condensed table-fixed" cellspacing="0" width="100%">
<col width="50px">
<col width="350px">
<thead>
<tr>
<td></td>
<td><label class="align-table">Description</label></td>
</tr>
</thead>
<tbody>
<tr>
<td><img src="<?= $root; ?>/assets/img/details_close.png" class="link removeRow"></td>
<td>
<input name="txtDescription[]" data-target=".container-fluid" class="form-control selectDescription" data-provide="typeahead" autocomplete="off" name="txtDescription_0" type="text" placeholder="" value="">
</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
Below is my JavaScript code snippet:
$('.selectDescription').typeahead({
minLength: 3,
items: 5,
delay: 400,
source: function (query, response) {
$.ajax({
url: '<?= $root; ?>/get_list',
dataType: "json",
type: 'POST',
data: {
query: query
},
success: function (data) {
return response(data.list);
}
});
},
displayText: function (item) {
return item.text;
}
});
Here is the image: https://i.sstatic.net/gC1CR.jpg
UPDATE JSFiddle example