The details for this can be found in ticket #1519224
Given some XML that has child nodes and attributes, I'm binding to a grid with no problem. The child grid for each row (built using detailInit) get's the data from the parent row e.data.get("BillRows")
If those rows have attributes, the '@' signs breaks the javascript for the grid. As you can see in the ticket, every attribute needs to be renamed before I can build the child grid.
Should be a way to use attributes in XML bound to a datasource/grid for all levels of grids.
Rick
Hi Rick, and thanks for the feedback.
Following a recent review, we have decided to reopen this feature request since it addresses a valid scenario
After investigating, we found that this scenario works out of the box since 2023 R1 (version 2023.1.117). Attribute fields such as "@BillID" can be used in the model of a nested (detail) grid, and the data from e.data.get("BillRows") binds correctly at every level of the hierarchy. In version 2022.3.1109 and earlier, the same code throws Invalid or unexpected token, and this is the behavior described in this item.
You can see the difference in the following Dojo samples, which use the XML structure from your ticket with three levels (Group > Bill > TF):
Recommended solution: update to the latest version of Kendo UI 2026.3.1015, which also provides support for the modern browsers, stability, accessibility and security improvements.
Workaround for older versions: if you cannot upgrade, normalize the data before passing it to the child grid. The helper below removes the @ prefix from the keys only, so values such as e-mail addresses are not changed. It also drops #text and wraps a single child element in an array:
function normalize(node) {
if (Array.isArray(node)) {
return node.map(normalize);
}
if (node && typeof node === "object") {
var result = {};
Object.keys(node).forEach(function (key) {
if (key === "#text") {
return;
}
result[key.replace(/^@/, "")] = normalize(node[key]);
});
return result;
}
return node;
}
function asArray(value) {
var json = value && value.toJSON ? value.toJSON() : value;
return normalize([].concat(json || []));
}In each detailInit, call options.success(asArray(e.data.get("BillRows"))) and map the model fields without the @ (for example BillID: "BillID"). The same pattern can be applied to any number of nested levels.
Since the issue is resolved in the current versions, we are marking this item as Completed.
Regards,
Rumen
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi,
We’re closing this feature request due to inactivity and limited demand. If interest increases in the future, we’ll be happy to revisit it.
Regards,
Viktor Tachev
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.