Hello
I have a grid and each row can be expanded, using detailInit, to show an inner grid.
I fetch the data beforehand so that I can populate the grid using local data.
In inner grid I have a column with a delete button - using template I call a delete function passing this as a parameter.
// column definition
{
field: "delete",
title: "Delete",
width: 50,
template: "<span class='delete' onclick='delete(this)'><img src='.delete_icon.png'/></span>"
},
my delete function :
function delete(e) { let Loader = KENDO.KendoLoader($("body")); try { Loader.Show(); let row = $(e).closest("tr"); let grid = $(e).closest(".innerGrid"); let dataItem = KENDO.KendoGrid(grid).GetDataItem(row); let innerRowId= dataItem.id; let parentRow = row.parent().closest(".k-detail-row").prev(); let parentDataItem = KENDO.KendoGrid($("#ParentGrid")).GetDataItem(parentRow); KENDO.KendoGrid(grid).DeleteUI([innerRowId]); // DeleteUI gets array of ids to delete , implemented below // if no rows remain in inner grid, I need to update a column's value in the parent row if (KENDO.KendoGrid(grid).HasRows() == false) { grid.hide(); grid.siblings(".noRecordsFound").show(); let updatedDataObj = { id: parentDataItem.id, someColumnOnParentRow: null } KENDO.KendoGrid($("#ParentGrid")).UpdateUI([updatedDataObj]); // UpdateUI gets array of objects to update, implemented below } } catch (error) { debugger; console.log(error.message); } finally { Loader.Hide(); } }
We have created a own KENDO wrapper script for different widgets. Here is the kendoGrid code:
let KENDO = { KendoComponent(jQueryElement, component, options = null) { let kendoComponent = {}; kendoComponent.InitKendoComponent = function () { let kComponent = jQueryElement.data(component); if (!kComponent) { if (options) { kComponent = jQueryElement[component](options).data(component); } else { kComponent = jQueryElement[component]().data(component); } } return kComponent; }; return kendoComponent; }, KendoGrid(jQueryElement, options = null) { let kendoGrid = {}; let kGrid = KENDO.KendoComponent(jQueryElement, "kendoGrid", options).InitKendoComponent(); if (options) kGrid.setOptions(options); kendoGrid.SetOptions = function (options) { kGrid.setOptions(options); return kendoGrid; } kendoGrid.GetData = function () { return Array.from(kGrid.dataSource.data()); } kendoGrid.GetDataItem = function (jQueryTableRow) { return kGrid.dataItem(jQueryTableRow); } kendoGrid.UpdateUI = function (dataToUpdate = []) { dataToUpdate.forEach(obj => { let dataItem = kGrid.dataSource.get(obj.id); if (dataItem) { for (let prop in obj) { if (prop !== "id") { dataItem.set(prop, obj[prop]); } } } }); return kendoGrid; } kendoGrid.DeleteUI = function (idsToDelete = []) { idsToDelete.forEach(id => { let dataItem = kGrid.dataSource.get(id); if (dataItem) kGrid.dataSource.remove(dataItem); }); return kendoGrid; }; kendoGrid.HasRows = function () { return kGrid.dataSource.data().length > 0; } return kendoGrid; } }
It appears that UpdateUI does not function as it should.
When I test I notice that when the last remaining row of inner grid is deleted, the parent row's column is indeed updated to null, the No Records Found message is shown instead of the inner grid, the parent row gets collapsed, and when I expand it the inner grid is shown with the last remaining row.
Suprisingly, if I comment out the UpdateUI line, the inner grid's row gets deleted, without collapsing the inner grid and the No Records Found message is shown as intended (the parent row's column does not get updated in this case, obviously).
Is it a bug in Kendo ? or am I doing something wrong?
For certain types of data in my grid, I need to define custom filter operators, e.g.:
updateOrAddFilter(fieldKey, {
field: fieldKey, operator: function (item) {
const nItem = normalize(item);
const nValue = normalize(value);
return nItem && nItem.includes(nValue);
}
});
The updateOrAddFilter function then browses through the all the filters currently applied to the grid's dataSource, replaces old current-column filters with the new one and keeps all the other-column ones, and updates the grid's dataSource as such:
grid.dataSource.filter({ logic: "and", filters: updatedFilters });
I've seen your demos on setting up the type: "date" and the format: stuff on the model and on the column display for the grid. Your demo sorts the dates as if they are dates properly. Ours shows the value as null if we set the type to date. It displays the string properly if we set it to type string but still sorts as a string. If we simply set the column to the kendo format and do not use a schema on the datasource, our code still sorts as a string.
https://dojo.telerik.com/TgCibbiL
When I looked at the data in your demo, it looks like the long form GMT. Today, we are instead blocking the script from sending the .NET property types of DateTime and instead sending a pre-formatted string of the date. Ran into some serialization issues when posting those same objects with DateTime properties on them.
Are you returning your DateTime properties as strings but formatted in this GMT when you serialize your .NET data objects back to the JavaScript handlers?
Module Bundlers - Kendo UI Third-Party Tools - Kendo UI for jQuery
The module bundlers page references Vite as an example which leads me to believe that it can be used with Kendo.
However even this basic example doesn't appear to work: https://stackblitz.com/edit/vitejs-vite-i842ucun?file=src%2Fmain.js
Am I doing something wrong?
When you touch-drag the grid, it doesn't look good if you move it diagonally. It's confusing. It looks distracting. What if you only want it to move up and down, or left and right?
Isn't there a very simple code?
Thank you.
Expected:
When a scrollable grid has loaderType = 'skeleton', and when a user clicks sort on a column, the scroll bar will not move.
Actual:
The scrollbar resets to the beginning.
Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Kendo UI Snippet</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2025.1.227/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/themes/10.2.0/default/default-ocean-blue.css">
<script src="https://unpkg.com/jszip/dist/jszip.min.js"></script>
</head>
<body>
<div id="grid"></div>
<script>
// The dataSource is initialized as a stand-alone widget that can be bound to the Grid.
var dataSource = new kendo.data.DataSource({
transport: {
read: {
// The remote endpoint from which the data is retrieved.
url: "https://demos.telerik.com/kendo-ui/service/products",
dataType: "jsonp"
}
},
pageSize: 10
});
$("#grid").kendoGrid({
// The dataSource configuration is set to an existing DataSource instance.
dataSource: dataSource,
pageable: true,
columns: [
{width: 500, field: 'ProductID' },
{width: 500, field: 'ProductName' },
{width: 500, field: 'UnitPrice' },
{width: 500, field: 'UnitsInStock' },
{width: 500, field: 'Discontinued' },
{width: 500, field: 'test' }
],
scrollable: true,
sortable: true,
loaderType: "skeleton",
});
</script>
</body>
</html>
Dojo: https://dojo.telerik.com/gmdqkCcS
Is there a fix/workaround for this?
Hello,
I'm trying to export a grid into a excel file with images but it's not working in 2024 version.
I had a 2022 version before and it was working, but upgrading for 2024.4.1112 it no longer works. It shows an error "The file wasn't available on site"
The example from https://dojo.telerik.com/RWscVNYF doesn't work.
Can you please help?
Thank you.
I'm using Kendo UI for jquery to show a grid in a bootstrap modal window.
The grid has column header filters, but the user cannot input text in the filter.
You can test this issue using this example:
https://dojo.telerik.com/ESmbjbbT/4
The full example code is:
<!DOCTYPE html>
<html>
<head>
<base href="https://demos.telerik.com/kendo-ui/grid/filter-row">
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<title></title>
<link href="https://kendo.cdn.telerik.com/themes/10.2.0/default/default-main.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2025.1.227/js/kendo.all.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js" integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq" crossorigin="anonymous"></script>
</head>
<body>
<div id="example">
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="grid" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
schema: {
model: {
fields: {
OrderID: { type: "number" },
Freight: { type: "number" },
ShipName: { type: "string" },
OrderDate: { type: "date" },
ShipCity: { type: "string" }
}
}
},
pageSize: 20,
serverPaging: true,
serverFiltering: true,
},
height: 550,
filterable: true,
pageable: true,
columns:
[{
field: "OrderID",
width: 80,
filterable: {
cell: {
showOperators: false
}
}
},
{
field: "ShipName",
width: 180,
title: "Ship Name",
filterable: {
cell: {
operator: "contains",
suggestionOperator: "contains"
}
}
},{
field: "Freight",
width: 80,
filterable: {
cell: {
operator: "gte"
}
}
},{
field: "OrderDate",
width: 95,
title: "Order Date",
format: "{0:MM/dd/yyyy}"
}]
});
});
</script>
</div>
</body>
</html>
Hi;
I have a problem with kendo grid on rtl languages. the horizontal scrollbar doesn't move as I drag a column in order to reorder it!
and when trying to move the last column, the scrollbar jumps to the beginning and doesn't let you do your thing.
Here is a replication of my problem: https://dojo.telerik.com/pMuIrqLj
can anybody help me solve this issue?