I filled kendo data source with json got help from this link. Now i want to get selected row values on dataBound event.As my json is filled with runtime generated input fields and select boxes and i have no idea about column names.I used dform for form building now dform captions are converted to kendo grid headers and input fields or select box selected values are converted to kendo grid header column values.So is there a way to iterate index based over selected rows values. Thanks.
0
votes
1 Answers
0
votes
The following code snippet shows an example of how you can get the selection and the grid columns and use them together to iterate over the fields of the selected rows:
let grid = $("#grid").data("kendoGrid");
let selectedRows = grid.dataItems(grid.select());
let columns = grid.columns.map(column => column.field);
selectedRows.forEach(row => {
columns.forEach(column => {
console.log(row[column]);
});
});