'grid.dataItem(row) is returning undefined
Using a kendo data grid, i am adding the model value in the databound event for a column
However the model is returned as undefined ,
here is teh code ,
let grid = $('#TypeGrid').data('kendoGrid');
grid.tbody.find('.progress').each(function() {
let row = $(this).closest('tr');
let model = grid.dataItem(row);//undefined
$(this).kendoProgressBar({
max: 100,
value: model.value
});
});
not sure why i get undefined , i do get the row but grid.dataItem(row) is undefined
Solution 1:[1]
let grid = $('#TypeGrid').data('kendoGrid');
grid.tbody.find('.progress').each(function(index, row) {
let row = $(this).closest('tr');
let model = grid._data[index];
$(this).kendoProgressBar({
max: 100,
value: model.value
});
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dinesh |