Giải pháp chuyển đổi số trọn gói cho doanh nghiệp Việt
Trong thư mục apps/ecommerce/views/cars
Tạo một folder có tên là tmpl
Sau đó tạo một file có tên là list.js
Nội dung file
<main role="main" class="view-cars-list col-md-9 col-md-offset-2 ml-sm-auto col-lg-12">
<div class="col-sm-12">
<h2>Cars</h2>
</div>
<div class="col-sm-12">
{{{htmltoobar}}}
<form action="/task" class="form-vertical" name="admin-form" id="admin-form" method="post"
data-toggle="validator">
<table class="list-cars table table-bordered">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Year</th>
<th>Image</th>
<th>Category</th>
<th>Status</th>
<th>Is feature</th>
<th>Note</th>
</tr>
</thead>
<tbody>
{{#each list_item}}
<tr>
<td>{{this._id}}</td>
<td><a href="/cars/form/{{this._id}}">{{this.name}}</a></td>
<td>{{this.year}}</td>
<td><img src="/{{this.image}}" style="width: 100px"></td>
<td>{{this.category}}</td>
<td>{{> (render_item_html_backend "yesno") value=this.status}}</td>
<td>{{> (render_item_html_backend "yesno") value=this.is_featured}}</td>
<td>{{this.note}}</td>
</tr>
{{/each}}
</tbody>
</table>
<input type="hidden" id="carsPerPage" value="{{carsPerPage}}">
<input type="hidden" id="pageNum" value="{{pageNum}}">
<input type="hidden" id="totalProductCount" value="{{totalProductCount}}">
<input type="hidden" id="paginateUrl" value="{{paginateUrl}}">
<div class="col-md-12">
<div id="pager" class="d-flex justify-content-center"></div>
</div>
</form>
</div>
</main>
<script>
jQuery(document).ready(function ($) {
$('.view-cars-list').view_cars_list({
});
});
</script>
Chưa có câu hỏi nào cho bài này.