Мои параметры Входное автозаполнение отсутствует из моего ввода.
Laravel: 5,5
Контроллер:
$ (документ) .on ('focus', ' .autocomplete_txt_APO ', function () {type = $ (this) .data (' type ');
autoType =' db_arti c ';
$ (this) .autocomplete ( {minLength: 0, источник: функция (запрос, ответ) {$. ajax ({url: "{{route ('search ajax')}}", dataType: "json", data: { term: request.term, тип: type,}, success: function (data) {var array = $ .map (data, function (item) {return {label: item [autoType], значение: item [autoType], данные : item}}); response (array)}});}, выберите: function (event, ui) {var data = ui.item.data;
id_arr = $ (this) .attr ('id') ; id = id_arr.split ("_"); elementId = id [id.length-1]; $ ('# inp_artic _' + elementId) .val (data.db_arti c); $ ('# inp_vrund _' + elementId) .val (data.db_vrund); $ ('# inp_idmat _' + elementId) .val (data.db_idmat);}});
});
<table class="table table-bordered">
<tr>
<th class="text-center" width="5%">No.</span></th>
<th class="text-center" width="35%">Material</span></th>
<th class="text-center" width="12%">Cant</span></th>
<th class="text-center" width="18%">Vr(UND)</span></th>
<th class="text-center" width="20%">Vr(TOT)</span></th>
<th class="text-center" width="10%">Action</span></th>
</tr>
<tr>
***<td align="center"><span class="badge badge-light" id='sn'>1</span></td>
<td><input class="form-control autocomplete_txt_APO" autocomplete='off' type='text'
data-type="inp_artic" id='inp_artic_1' name='inp_artic[]'
placeholder='Ingrese artículo...' required/></td>***
<td><input class="form-control autocomplete_txt" autocomplete='false' type='number' step='any'
data-type="inp_cantd" id='inp_cantd_1' name='inp_cantd[]'
placeholder='Cantidad...' required/> </td>
<td><input class="form-control autocomplete_txt" autocomplete='false' type='number' step='any'
data-type="inp_vrund" id='inp_vrund_1' name='inp_vrund[]'
placeholder='Valor Unidad...' required/> </td>
<td><input class="form-control autocomplete_txt" type='number' step='any'
data-type="inp_vrtot" id='inp_vrtot_1' name='inp_vrtot[]'
placeholder='Valor TOTAL' disabled /> </td>
<td style="display:none;"><input class="form-control autocomplete_txt" type='number' step='any'
data-type="inp_idmat" id='inp_idmat_1' name='inp_idmat[]'/> </td> <!-- colHidden -->
<td align="center"><button type="button" name="add" id="add" class='btn btn-success addbtn'>+Adicionar</button></td>
</tr>
<tfoot>
<tr>
<td colspan="5" align="right"> </td>
<td align="center">
{{ csrf_field() }}
<input type="submit" name="save" id="save" class="btn btn-primary" value="Generar" />
</td>
</tr>
</tfoot>
</table>
изображение вид