【发布时间】:2017-02-27 16:44:32
【问题描述】:
嘿,朋友们,我正在创建一个简单的模式来向我展示提供商的数据,老实说,这让我付出了很多;有人可以帮帮我吗?
模态:
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModal">
<div class="modal-dialog"
role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModal">Detalle del Proveedor: </h4>
</div>
<div class="modal-body">
<div class="table-responsive">
<table class="table table-stripped table-bordered table-hover" id="table-detalle-proveedores">
<thead>
<tr>
<th>Nombre</th>
<th>Apellido</th>
<th>Telefono</th>
<th>Email</th>
<th>Dirección</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
模态按钮
<a href="" class="btn btn-primary btn-detalle-proveedores" data-id="{{ $proveedores->id }}"
data-path="{{ route('admin.proveedores.item') }}" data-toggle="modal"
data-target="#myModal"
data-token="{{ csrf_token() }}">
<i class="fa fa-external-link"></i>
</a>
路线
Route::post('admin/proveedores/item', [
'as' => 'admin.proveedores.item',
'uses' => 'ProveedoresController@Item']);
控制器功能
public function item(Request $request)
{
$items = Proveedores::select($request->id);
return json_encode($items);
}
我正在测试那个和其他的,但我得到它的最大值是在控制台中向我显示一个空对象
【问题讨论】:
标签: html ajax laravel modal-dialog