Hello,
I have a Kendo grid connected to a DataSource. One of the data members of the DataSource is an array of integers and I'd like to set them in a grid cell in the row for the entity as a SparkLine.
You can see the 'YtdQuality' field. This is the array of integers. I'd like to make this array of 12 integers be the datasource for the SparkLine in each column.
Any idea on how to do this? I tried to make it a SparkLine in the dataBound function, but I was getting an error about the HTML template not working correctly. Without the function there it simply puts [Object object] in the cell for YtdQuality.
I have a Kendo grid connected to a DataSource. One of the data members of the DataSource is an array of integers and I'd like to set them in a grid cell in the row for the entity as a SparkLine.
<
div
id
=
"otdQaGrid"
></
div
>
<!-- JavaScript -->
$(document).ready(function () {
dash.grid = $("#otdQaGrid").kendoGrid({
dataSource: {
type: "json",
transport: {
read: {
url: "/api/GetOtdAndQuality",
}
}
},
columns: [{
field: "CustomerName",
title: "Customer",
width: 200
}, {
field: "QualityAverage",
title: "Avg. Quality"
}, {
field: "OtdAverage",
title: "Avg. OTD"
}, {
field: "TotalParts",
title: "# of Parts",
width: 150
}, {
field: "MeetsOtd",
title: "MeetsOtd"
}, {
field: "YtdQuality",
title: "YTD Quality",
template: "<
span
class
=
'inlinespark'
>#: YtdQuality #</
span
>"
}],
height: 550,
dataBound: function (e) {
}
});
});
You can see the 'YtdQuality' field. This is the array of integers. I'd like to make this array of 12 integers be the datasource for the SparkLine in each column.
Any idea on how to do this? I tried to make it a SparkLine in the dataBound function, but I was getting an error about the HTML template not working correctly. Without the function there it simply puts [Object object] in the cell for YtdQuality.