-
Anonymous
DataTable не отображается в Laravel
Сообщение
Anonymous »
Это мой код JavaScript.
Код: Выделить всё
$(document).ready(function(){
$(document).on('change', '#time', function () {
time = $('#time').val();
var url = '{{ route("owner.safety.timeOverview", ":time") }}';
url = url.replace(':time', time);
$('#overview').DataTable({
bDestroy: true,
processing: true,
serverSide: true,
pageLength: 100,
responsive: true,
ajax: {
url: url,
type: 'GET',
headers: {
'Accept': 'application/json'
},
success: function(response) {
console.log(response); // I am getting output here
},
},
order: [1, 'desc'],
ordering: false,
autoWidth: false,
drawCallback: function () {
$(".dataTables_length select").addClass("form-select form-select-sm");
},
language: {
'paginate': {
'previous': '',
'next': ''
}
},
columns: [
{
"data": "property_id",
},
{
"data": "unit_id",
},
{
"data": "issue_date",
},
{
"data": "expiry_date",
},
{
"data": "certified_by",
},
{
"data": "safety",
},
{
"data": "reminder",
},
]
});
});
});
Мой HTML такой.
Код: Выделить всё
{{ __('Property') }}
{{ __('Unit') }}
{{ __('Issue Date') }}
{{ __('Expiry Date') }}
{{ __('Certified by') }}
{{ __('Safety Type') }}
{{ __('Status') }}
Раскрывающийся HTML-код показан ниже.
Я не получаю никаких ошибок в консоли.
Подробнее здесь:
https://stackoverflow.com/questions/785 ... in-laravel
1716295414
Anonymous
Это мой код JavaScript.
[code]$(document).ready(function(){
$(document).on('change', '#time', function () {
time = $('#time').val();
var url = '{{ route("owner.safety.timeOverview", ":time") }}';
url = url.replace(':time', time);
$('#overview').DataTable({
bDestroy: true,
processing: true,
serverSide: true,
pageLength: 100,
responsive: true,
ajax: {
url: url,
type: 'GET',
headers: {
'Accept': 'application/json'
},
success: function(response) {
console.log(response); // I am getting output here
},
},
order: [1, 'desc'],
ordering: false,
autoWidth: false,
drawCallback: function () {
$(".dataTables_length select").addClass("form-select form-select-sm");
},
language: {
'paginate': {
'previous': '',
'next': ''
}
},
columns: [
{
"data": "property_id",
},
{
"data": "unit_id",
},
{
"data": "issue_date",
},
{
"data": "expiry_date",
},
{
"data": "certified_by",
},
{
"data": "safety",
},
{
"data": "reminder",
},
]
});
});
});
[/code]
Мой HTML такой.
[code]
{{ __('Property') }}
{{ __('Unit') }}
{{ __('Issue Date') }}
{{ __('Expiry Date') }}
{{ __('Certified by') }}
{{ __('Safety Type') }}
{{ __('Status') }}
[/code]
Раскрывающийся HTML-код показан ниже.
[code]
Select
1 Week
1 Month
3 Months
6 Months
[/code]
Я не получаю никаких ошибок в консоли.
Подробнее здесь: [url]https://stackoverflow.com/questions/78511930/datatable-is-not-showing-in-laravel[/url]