Anonymous
Сетка Кендо не отображается
Сообщение
Anonymous » 12 май 2024, 22:14
У меня проблема с отрисовкой сетки Кендо.
У меня есть следующий код:
Код: Выделить всё
$(document).ready(function() {
$('#searchBtn').click(function(event) {
event.preventDefault();
var origin = $('#origin').val();
var destination = $('#destination').val();
$.ajax({
url: '/home/search',
type: 'GET',
//dataType: 'json',
data: {
origin: origin,
destination: destination
},
success: function(data) {
console.log('Flight data received:', data);
initializeKendoGrid(data);
},
error: function(xhr, status, error) {
console.error(error);
alert('An error occurred while fetching flight data.');
}
});
});
});
function initializeKendoGrid(data) {
$("#grid").kendoGrid({
dataSource: {
data: data,
pageSize: 10
},
height: 550,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [
{ field: "flightNumber", title: "Flight Number" },
{ field: "airlineName", title: "Airline Name" },
{ field: "origin", title: "Origin" },
{ field: "destination", title: "Destination" },
{ field: "date", title: "Date", format: "{0:MM/dd/yyyy}" },
{ field: "departure", title: "Departure" },
{ field: "arrival", title: "Arrival" },
{ field: "price", title: "Price" }
]
});
}
Мне удается получить данные (ArrayList) из базы данных, но они не отображаются в сетке.
Я получаю сообщение об ошибке «Uncaught RangeError: максимальный размер стека вызовов». превысило». Кто-нибудь может помочь?
Подробнее здесь:
https://stackoverflow.com/questions/784 ... -displayed
1715541255
Anonymous
У меня проблема с отрисовкой сетки Кендо. У меня есть следующий код: [code]$(document).ready(function() { $('#searchBtn').click(function(event) { event.preventDefault(); var origin = $('#origin').val(); var destination = $('#destination').val(); $.ajax({ url: '/home/search', type: 'GET', //dataType: 'json', data: { origin: origin, destination: destination }, success: function(data) { console.log('Flight data received:', data); initializeKendoGrid(data); }, error: function(xhr, status, error) { console.error(error); alert('An error occurred while fetching flight data.'); } }); }); }); function initializeKendoGrid(data) { $("#grid").kendoGrid({ dataSource: { data: data, pageSize: 10 }, height: 550, groupable: true, sortable: true, pageable: { refresh: true, pageSizes: true, buttonCount: 5 }, columns: [ { field: "flightNumber", title: "Flight Number" }, { field: "airlineName", title: "Airline Name" }, { field: "origin", title: "Origin" }, { field: "destination", title: "Destination" }, { field: "date", title: "Date", format: "{0:MM/dd/yyyy}" }, { field: "departure", title: "Departure" }, { field: "arrival", title: "Arrival" }, { field: "price", title: "Price" } ] }); } [/code] Мне удается получить данные (ArrayList) из базы данных, но они не отображаются в сетке. Я получаю сообщение об ошибке «Uncaught RangeError: максимальный размер стека вызовов». превысило». Кто-нибудь может помочь? Подробнее здесь: [url]https://stackoverflow.com/questions/78469037/kendo-grid-not-getting-displayed[/url]